diff options
Diffstat (limited to 'test')
147 files changed, 0 insertions, 6905 deletions
diff --git a/test/antunit/common.xml b/test/antunit/common.xml deleted file mode 100644 index 3968898..0000000 --- a/test/antunit/common.xml +++ /dev/null @@ -1,37 +0,0 @@ -<project name="common" - xmlns:au="antlib:org.apache.ant.antunit" - xmlns:antcontrib="antlib:net.sf.antcontrib" - xmlns:ivy="antlib:fr.jayasoft.ivy.ant"> - - <target name="setUp"> - <dirname property="common.dir" file="${ant.file.common}" /> - <property name="root.dir" location="${common.dir}/../../" /> - <path id="ivy.lib.path"> - <fileset dir="${root.dir}/lib/ivy/jars" includes="ivy-1.3.1.jar"/> - <fileset dir="${root.dir}/lib/commons-cli/jars" includes="commons-cli-1.0.jar"/> - <fileset dir="${root.dir}/lib/commons-codec/jars" includes="commons-codec-1.3.jar"/> - <fileset dir="${root.dir}/lib/commons-httpclient/jars" includes="commons-httpclient-3.0.1.jar"/> - <fileset dir="${root.dir}/lib/commons-logging/jars" includes="commons-logging-1.0.4.jar"/> - <fileset dir="${root.dir}/lib/oro/jars" includes="oro-2.0.8.jar"/> - </path> - - <taskdef resource="fr/jayasoft/ivy/ant/antlib.xml" - uri="antlib:fr.jayasoft.ivy.ant" - classpathref="ivy.lib.path"/> - - <ivy:configure file="${root.dir}/ivy-conf.xml" /> - <ivy:resolve file="${root.dir}/ivy.xml" /> - <ivy:cachepath pathid="test.classpath" type="jar" conf="test" /> - <taskdef resource="net/sf/antcontrib/antlib.xml" - uri="antlib:net.sf.antcontrib"> - <classpath> - <pathelement location="${root.dir}/target/classes" /> - <path refid="test.classpath" /> - </classpath> - </taskdef> - </target> - - <target name="tearDown"> - </target> - -</project>
\ No newline at end of file diff --git a/test/antunit/property/pathtofileset.xml b/test/antunit/property/pathtofileset.xml deleted file mode 100644 index 8ce9292..0000000 --- a/test/antunit/property/pathtofileset.xml +++ /dev/null @@ -1,75 +0,0 @@ -<project name="pathtofileset" - xmlns:au="antlib:org.apache.ant.antunit" - xmlns:antcontrib="antlib:net.sf.antcontrib"> - <import file="../common.xml" /> - - <target name="setUp" depends="common.setUp"> - <property name="test.dir" value="${root.dir}/target/resources/pathtofileset"/> - <mkdir dir="${test.dir}/0/0"/> - <mkdir dir="${test.dir}/0/1"/> - <mkdir dir="${test.dir}/1/0"/> - <mkdir dir="${test.dir}/1/1"/> - <touch file="${test.dir}/0/0/0.java"/> - <touch file="${test.dir}/0/1/1.java"/> - <touch file="${test.dir}/1/0/2.java"/> - <touch file="${test.dir}/1/1/3.java"/> - </target> - - <target name="testSimple"> - <path id="simple"> - <fileset dir="${test.dir}/0" includes="**/*.java"/> - <fileset dir="${test.dir}/1" includes="**/*.java"/> - </path> - - <antcontrib:pathtofileset - dir="${test.dir}/0" - pathrefid="simple" - ignoreNonRelative="yes" - name="simple.0.fileset"/> - - <pathconvert - targetos="unix" - refid="simple.0.fileset" - property="simple.0.property"/> - - <antcontrib:pathtofileset - dir="${test.dir}/1" - pathrefid="simple" - ignoreNonRelative="yes" - name="simple.1.fileset"/> - - <pathconvert - targetos="unix" - refid="simple.1.fileset" - property="simple.1.property"/> - - - <au:assertTrue> - <and> - <contains string="${simple.0.property}" substring="0.java" /> - <contains string="${simple.0.property}" substring="1.java" /> - <not><contains string="${simple.0.property}" substring="2.java" /></not> - <not><contains string="${simple.0.property}" substring="3.java" /></not> - <contains string="${simple.1.property}" substring="2.java" /> - <contains string="${simple.1.property}" substring="3.java" /> - <not><contains string="${simple.1.property}" substring="0.java" /></not> - <not><contains string="${simple.1.property}" substring="1.java" /></not> - </and> - </au:assertTrue> - </target> - - <target name="testSimpleException"> - <path id="simple"> - <fileset dir="${test.dir}/0" includes="**/*.java"/> - <fileset dir="${test.dir}/1" includes="**/*.java"/> - </path> - - <au:expectfailure expectedMessage="is not relative to"> - <antcontrib:pathtofileset - dir="${test.dir}/0" - pathrefid="simple" - name="simple.0.fileset"/> - </au:expectfailure> - </target> - -</project>
\ No newline at end of file diff --git a/test/antunit/property/propertycopy.xml b/test/antunit/property/propertycopy.xml deleted file mode 100644 index 87f5d6e..0000000 --- a/test/antunit/property/propertycopy.xml +++ /dev/null @@ -1,42 +0,0 @@ -<project name="propertycopy" - xmlns:au="antlib:org.apache.ant.antunit" - xmlns:antcontrib="antlib:net.sf.antcontrib"> - <import file="../common.xml" /> - - <target name="testCopy"> - <property name="org" value="MyOrg" /> - <property name="org.MyOrg.DisplayName" value="My Organiziation" /> - <antcontrib:propertycopy name="displayName" from="org.${org}.DisplayName" /> - - <au:assertPropertyEquals name="displayName" - value="${org.MyOrg.DisplayName}" - message="displayName failed" /> - </target> - - <target name="testSilent"> - <antcontrib:propertycopy name="foo" from="bar" silent="true"/> - <au:assertTrue> - <not> - <isset property="foo" /> - </not> - </au:assertTrue> - </target> - - <target name="testNotSilent"> - <au:expectfailure expectedmessage="Property 'bar' is not defined."> - <antcontrib:propertycopy name="foo" from="bar"/> - </au:expectfailure> - </target> - - <target name="testMissingName"> - <au:expectfailure expectedmessage="You must specify a property to set."> - <antcontrib:propertycopy from="bar"/> - </au:expectfailure> - </target> - - <target name="testMissingFrom"> - <au:expectfailure expectedmessage="Missing the 'from' attribute."> - <antcontrib:propertycopy name="foo"/> - </au:expectfailure> - </target> -</project>
\ No newline at end of file diff --git a/test/antunit/property/propertyselector.xml b/test/antunit/property/propertyselector.xml deleted file mode 100644 index 016f159..0000000 --- a/test/antunit/property/propertyselector.xml +++ /dev/null @@ -1,44 +0,0 @@ -<project name="propertycopy" - xmlns:au="antlib:org.apache.ant.antunit" - xmlns:antcontrib="antlib:net.sf.antcontrib"> - <import file="../common.xml" /> - - <property name="module.Module1.id" value="1" /> - <property name="module.Module1.name" value="Module 1" /> - <property name="module.Module2.id" value="2" /> - <property name="module.Module2.name" value="Module 2" /> - <property name="module.Module2.foo.id" value="3" /> - <property name="module.Module2.foo.name" value="Module 3" /> - - <target name="testGrouping0"> - <antcontrib:propertyselector property="module.list" - match="module\.([^\.]*)\.id" - delimiter="," - casesensitive="false" /> - - <au:assertTrue> - <and> - <contains string="${module.list}" substring="module.Module1.id" /> - <contains string="${module.list}" substring="module.Module2.id" /> - <not><contains string="${module.list}" substring="module.Module3.foo.id" /></not> - </and> - </au:assertTrue> - </target> - - <target name="testGrouping1"> - <antcontrib:propertyselector property="module.list" - match="module\.([^\.]*)\.id" - select="\1" - delimiter="," - casesensitive="false" /> - <au:assertTrue> - <and> - <not><contains string="${module.list}" substring="module." /></not> - <not><contains string="${module.list}" substring=".id" /></not> - <contains string="${module.list}" substring="Module1" /> - <contains string="${module.list}" substring="Module2" /> - <not><contains string="${module.list}" substring="Module3" /></not> - </and> - </au:assertTrue> - </target> -</project>
\ No newline at end of file diff --git a/test/antunit/property/variable.xml b/test/antunit/property/variable.xml deleted file mode 100644 index acd3ad1..0000000 --- a/test/antunit/property/variable.xml +++ /dev/null @@ -1,72 +0,0 @@ -<project name="propertycopy" - xmlns:au="antlib:org.apache.ant.antunit" - xmlns:antcontrib="antlib:net.sf.antcontrib"> - <import file="../common.xml" /> - - <!-- use like a standard property --> - <target name="test1"> - <antcontrib:var name="x" value="6" /> - <au:assertPropertyEquals name="x" value="6" /> - </target> - - <!-- use like a standard property --> - <target name="test2"> - <antcontrib:var name="x" value="12" /> - <au:assertPropertyEquals name="x" value="12" /> - </target> - - <!-- can append to itself --> - <target name="test3"> - <antcontrib:var name="x" value="12" /> - <antcontrib:var name="x" value="6 + ${x}" /> <!-- 6 + 12 --> - <au:assertPropertyEquals name="x" value="6 + 12" /> - </target> - - <!-- property can't override --> - <target name="test4"> - <antcontrib:var name="x" value="6" /> - <property name="x" value="12" /> - <au:assertPropertyEquals name="x" value="6" /> - </target> - - <!-- can append multiple times --> - <target name="test5"> - <antcontrib:var name="str" value="I" /> - <antcontrib:var name="str" value="${str} am" /> - <antcontrib:var name="str" value="${str} a" /> - <antcontrib:var name="str" value="${str} string." /> - <au:assertPropertyEquals name="str" value="I am a string." /> - </target> - - <!-- property can't override --> - <target name="test6"> - <antcontrib:var name="x" value="blue" /> - <tstamp> - <format property="x" pattern="EEEE" /> - </tstamp> - <antcontrib:var name="x" value="Today is ${x}."/> - <au:assertPropertyEquals name="x" value="Today is blue." /> - </target> - - <!-- can override property --> - <target name="test7"> - <property name="x" value="12" /> - <antcontrib:var name="x" value="6" /> - <au:assertPropertyEquals name="x" value="6" /> - </target> - - <target name="test9"> - <property name="i" value="2"/> - <antcontrib:var name="i" unset="true"/> - <au:assertTrue> - <not><isset property="i" /></not> - </au:assertTrue> - </target> - - <target name="test10"> - <antcontrib:var name="x" value="test"/> - <antcontrib:var name="x" unset="true"/> - <property name="x" value="xxx"/> - <au:assertPropertyEquals name="x" value="xxx" /> - </target> -</project>
\ No newline at end of file diff --git a/test/resources/antclipse/.classpath b/test/resources/antclipse/.classpath deleted file mode 100644 index 8a55b01..0000000 --- a/test/resources/antclipse/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <!-- this is an awfully hacked Eclipse classpath file, must find a way to test libs--> - <classpathentry kind="src" path="../../../src"/> - <classpathentry kind="src" path="../../../test/src"/> - <classpathentry kind="src" path="../../../test/resources"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="."/> -</classpath> diff --git a/test/resources/antclipse/antclipsetest.xml b/test/resources/antclipse/antclipsetest.xml deleted file mode 100644 index 460bbad..0000000 --- a/test/resources/antclipse/antclipsetest.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0"?> -<project default="everything" name="Antclipse test xml file" basedir="."> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - -<target name="make.fs.output"> - <!-- creates a fileset including all the files from the output directory, called ecl1-bin if your binary directory is bin/ --> - <antclipse produce="fileset" idcontainer="ecl1" includeoutput="true" includesource="false" - includelibs="false" verbose="true"/> -</target> - -<target name="make.fs.sources"> - <!-- creates a fileset for each source directory, called ecl2-*source-dir-name*/ --> - <antclipse produce="fileset" idcontainer="ecl2" includeoutput="false" includesource="true" - includelibs="false" verbose="true"/> -</target> - -<target name="make.fs.libs"> - <!-- creates a fileset sontaining all your project libs called ecl3/ --> - <antclipse produce="fileset" idcontainer="ecl3" verbose="true"/> -</target> - -<target name="make.cp"> - <!-- creates a fileset sontaining all your project libs called ecl3/ --> - <antclipse produce="classpath" idcontainer="eclp" verbose="true" includeoutput="true"/> -</target> - -<target name="everything" depends="make.fs.libs, make.fs.output, make.fs.sources, make.cp"> - <echo message="The output path is ${ecl1outpath}"/> - <echo message="The source path is ${ecl2srcpath}"/> - <!-- makes a jar file with the content of the output directory --> - <zip destfile="out.jar"><fileset refid="ecl1-${ecl1outpath}"/></zip> - <!-- makes a zip file with all your sources (supposing you have only source directory) --> - <zip destfile="src.zip"><fileset refid="ecl2-${ecl2srcpath}"/></zip> - <!-- makes a big zip file with all your project libraries --> - <zip destfile="libs.zip"><fileset refid="ecl3"/></zip> - <!-- imports the classpath into a property then echoes the property --> - <property name="cpcontent" refid="eclp"/> - <echo>The newly created classpath is ${cpcontent}</echo> -</target> -</project>
\ No newline at end of file diff --git a/test/resources/antserver/antservertest.xml b/test/resources/antserver/antservertest.xml deleted file mode 100644 index 77f8db0..0000000 --- a/test/resources/antserver/antservertest.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="Project" default="default" basedir="."> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> - - <property name="server.host" value="localhost" /> - <property name="server.port" value="17000" /> - - <target name="default"> - </target> - - <!-- =============================================== --> - <!-- TEST 1 --> - <!-- =============================================== --> - <target name="test1_remote"> - <echo message="Test1 Successfully Called" /> - </target> - - <target name="dotest1"> - <remoteant machine="${server.host}" port="${server.port}"> - <runtarget target="test1_remote"> - </runtarget> - </remoteant> - </target> - - <target name="test1"> - <antcall target="run.test.with.server"> - <param name="test.target" value="dotest1" /> - </antcall> - </target> - - <!-- =============================================== --> - <!-- TEST 2 --> - <!-- =============================================== --> - <target name="test2_remote"> - <echo message="${message}" /> - </target> - - <target name="dotest2"> - <remoteant machine="${server.host}" port="${server.port}"> - <runtarget target="test2_remote"> - <property name="message" value="Test2 Successfully Called" /> - </runtarget> - </remoteant> - </target> - - <target name="test2"> - <antcall target="run.test.with.server"> - <param name="test.target" value="dotest2" /> - </antcall> - </target> - - <!-- =============================================== --> - <!-- TEST 3 --> - <!-- =============================================== --> - <target name="test3_remote"> - <touch file="E:/test3.txt" /> - <echo message="Test3 Successfully Called" /> - </target> - - <target name="dotest3"> - <remoteant machine="${server.host}" port="${server.port}"> - <runant target="test3_remote" antfile="${ant.file}"> - </runant> - </remoteant> - </target> - - <target name="test3"> - <antcall target="run.test.with.server"> - <param name="test.target" value="dotest3" /> - </antcall> - </target> - - <!-- =============================================== --> - <!-- TEST 4 --> - <!-- =============================================== --> - <target name="test4_remote"> - <echo message="${message}" /> - </target> - - <target name="dotest4"> - <remoteant machine="${server.host}" port="${server.port}"> - <runant target="test4_remote" antfile="${ant.file}"> - <property name="message" value="Test4 Successfully Called" /> - </runant> - </remoteant> - </target> - - <target name="test4"> - <antcall target="run.test.with.server"> - <param name="test.target" value="dotest4" /> - </antcall> - </target> - - <target name="dotest5"> - <mkdir dir="servertests" /> - <remoteant machine="${server.host}" port="${server.port}"> - <sendfile file="clientfile.txt" todir="servertests" /> - </remoteant> - <available property="file.available" - file="servertests/clientfile.txt" /> - <fail unless="file.available" /> - </target> - - <target name="cleanup"> - <delete quiet="yes" dir="servertests"/> - </target> - - <target name="test5"> - <antcall target="run.test.with.server"> - <param name="test.target" value="dotest5" /> - </antcall> - </target> - <target name="run.test.with.server"> - <parallel> - <antserver port="${server.port}" /> - - <sequential> - <waitfor checkevery="500" checkeveryunit="millisecond"> - <socket port="${server.port}" server="${server.host}" /> - </waitfor> - - <trycatch> - <try> - <antcall target="${test.target}" /> - </try> - <finally> - <remoteant machine="${server.host}" port="${server.port}"> - <shutdown /> - </remoteant> - </finally> - </trycatch> - </sequential> - </parallel> - </target> - - -</project> diff --git a/test/resources/antserver/clientfile.txt b/test/resources/antserver/clientfile.txt deleted file mode 100644 index 68f4931..0000000 --- a/test/resources/antserver/clientfile.txt +++ /dev/null @@ -1 +0,0 @@ -This is the file from the client. diff --git a/test/resources/design/designfiles/arraydepend.xml b/test/resources/design/designfiles/arraydepend.xml deleted file mode 100644 index cdd0aeb..0000000 --- a/test/resources/design/designfiles/arraydepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.arraydepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/arraydepend2.xml b/test/resources/design/designfiles/arraydepend2.xml deleted file mode 100644 index ab8d8e4..0000000 --- a/test/resources/design/designfiles/arraydepend2.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.arraydepend2"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/arraydepend3.xml b/test/resources/design/designfiles/arraydepend3.xml deleted file mode 100644 index 1e30b7c..0000000 --- a/test/resources/design/designfiles/arraydepend3.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.arraydepend3"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/badxml.xml b/test/resources/design/designfiles/badxml.xml deleted file mode 100644 index 63c82f0..0000000 --- a/test/resources/design/designfiles/badxml.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.arraydepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/castdepend.xml b/test/resources/design/designfiles/castdepend.xml deleted file mode 100644 index ac16d41..0000000 --- a/test/resources/design/designfiles/castdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.castdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/catchdepend.xml b/test/resources/design/designfiles/catchdepend.xml deleted file mode 100644 index 2ff6387..0000000 --- a/test/resources/design/designfiles/catchdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.catchdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/declarejavautil.xml b/test/resources/design/designfiles/declarejavautil.xml deleted file mode 100644 index e2fb08e..0000000 --- a/test/resources/design/designfiles/declarejavautil.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.declarejavautil"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/declarejavautilfail.xml b/test/resources/design/designfiles/declarejavautilfail.xml deleted file mode 100644 index fd43256..0000000 --- a/test/resources/design/designfiles/declarejavautilfail.xml +++ /dev/null @@ -1,8 +0,0 @@ -<design> -<!-- needdeclarations is by default true, so we don't need that here --> -<package name="javautil" package="java.util"/> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.declarejavautil"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/declarejavax.xml b/test/resources/design/designfiles/declarejavax.xml deleted file mode 100644 index f2b7d13..0000000 --- a/test/resources/design/designfiles/declarejavax.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.declarejavax"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/declarejavaxpass.xml b/test/resources/design/designfiles/declarejavaxpass.xml deleted file mode 100644 index 7e55849..0000000 --- a/test/resources/design/designfiles/declarejavaxpass.xml +++ /dev/null @@ -1,7 +0,0 @@ -<design> -<package name="swing" package="javax.swing" needdeclarations="false"/> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.declarejavax"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/fielddepend.xml b/test/resources/design/designfiles/fielddepend.xml deleted file mode 100644 index 409427c..0000000 --- a/test/resources/design/designfiles/fielddepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.fielddepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/fieldrefdepend.xml b/test/resources/design/designfiles/fieldrefdepend.xml deleted file mode 100644 index 3a04f6a..0000000 --- a/test/resources/design/designfiles/fieldrefdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.fieldrefdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/innerclassdepend.xml b/test/resources/design/designfiles/innerclassdepend.xml deleted file mode 100644 index 2be90f6..0000000 --- a/test/resources/design/designfiles/innerclassdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.innerclassdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/instanceofdepend.xml b/test/resources/design/designfiles/instanceofdepend.xml deleted file mode 100644 index 2e9a3f8..0000000 --- a/test/resources/design/designfiles/instanceofdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.instanceofdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/interfacedepend.xml b/test/resources/design/designfiles/interfacedepend.xml deleted file mode 100644 index 9f11581..0000000 --- a/test/resources/design/designfiles/interfacedepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.interfacedepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/localvardepend.xml b/test/resources/design/designfiles/localvardepend.xml deleted file mode 100644 index 518bae1..0000000 --- a/test/resources/design/designfiles/localvardepend.xml +++ /dev/null @@ -1,9 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="factory" package="mod.temp" depends="dummy"/> -<package name="client" package="mod.localvardepend"> - <depends>factory</depends> -</package> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/localvarrefdepend.xml b/test/resources/design/designfiles/localvarrefdepend.xml deleted file mode 100644 index 6160330..0000000 --- a/test/resources/design/designfiles/localvarrefdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.localvarrefdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/missingattribute.xml b/test/resources/design/designfiles/missingattribute.xml deleted file mode 100644 index 5397c51..0000000 --- a/test/resources/design/designfiles/missingattribute.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package package="mod.dummy"/> -<package name="client" package="mod.arraydepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/multipleerrors.xml b/test/resources/design/designfiles/multipleerrors.xml deleted file mode 100644 index 3c6780d..0000000 --- a/test/resources/design/designfiles/multipleerrors.xml +++ /dev/null @@ -1,7 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.arraydepend"/> -<package name="client2" package="mod.catchdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/newdepend.xml b/test/resources/design/designfiles/newdepend.xml deleted file mode 100644 index b924645..0000000 --- a/test/resources/design/designfiles/newdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.newdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/newdepend2.xml b/test/resources/design/designfiles/newdepend2.xml deleted file mode 100644 index 4efc5bf..0000000 --- a/test/resources/design/designfiles/newdepend2.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.newdepend2"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/nodebugoption.xml b/test/resources/design/designfiles/nodebugoption.xml deleted file mode 100644 index 8ab00b7..0000000 --- a/test/resources/design/designfiles/nodebugoption.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.nodebugoption"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/nojar.xml b/test/resources/design/designfiles/nojar.xml deleted file mode 100644 index cdd0aeb..0000000 --- a/test/resources/design/designfiles/nojar.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.arraydepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/paramdepend.xml b/test/resources/design/designfiles/paramdepend.xml deleted file mode 100644 index 4c24f4f..0000000 --- a/test/resources/design/designfiles/paramdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.paramdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/passlocaldepend.xml b/test/resources/design/designfiles/passlocaldepend.xml deleted file mode 100644 index 8544ed5..0000000 --- a/test/resources/design/designfiles/passlocaldepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.passlocaldepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/pathelementpath.xml b/test/resources/design/designfiles/pathelementpath.xml deleted file mode 100644 index 84bd103..0000000 --- a/test/resources/design/designfiles/pathelementpath.xml +++ /dev/null @@ -1,7 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client1" package="mod.putstatic"/> -<package name="client2" package="mod.arraydepend2"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/putstatic.xml b/test/resources/design/designfiles/putstatic.xml deleted file mode 100644 index 92464e0..0000000 --- a/test/resources/design/designfiles/putstatic.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.putstatic"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/recursion.xml b/test/resources/design/designfiles/recursion.xml deleted file mode 100644 index 9aedd9e..0000000 --- a/test/resources/design/designfiles/recursion.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="temp" package="mod.recursion.rec" subpackages="include"/> -<package name="client" package="mod.recursion.client" depends="temp"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/recursion2.xml b/test/resources/design/designfiles/recursion2.xml deleted file mode 100644 index 94b41cd..0000000 --- a/test/resources/design/designfiles/recursion2.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="temp" package="mod.recursion2.dependency"/> -<package name="client" package="mod.recursion2.rec" depends="temp" subpackages="include"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/recursion3.xml b/test/resources/design/designfiles/recursion3.xml deleted file mode 100644 index 7fef148..0000000 --- a/test/resources/design/designfiles/recursion3.xml +++ /dev/null @@ -1,5 +0,0 @@ -<design> - -<package name="recursion" package="mod.recursion3" subpackages="include"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/returnvaldepend.xml b/test/resources/design/designfiles/returnvaldepend.xml deleted file mode 100644 index d1abdab..0000000 --- a/test/resources/design/designfiles/returnvaldepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.returnvaldepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/signatureexceptiondepend.xml b/test/resources/design/designfiles/signatureexceptiondepend.xml deleted file mode 100644 index 446333e..0000000 --- a/test/resources/design/designfiles/signatureexceptiondepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.signatureexceptiondepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/staticdepend.xml b/test/resources/design/designfiles/staticdepend.xml deleted file mode 100644 index 94e41c8..0000000 --- a/test/resources/design/designfiles/staticdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.staticdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/staticfield2depend.xml b/test/resources/design/designfiles/staticfield2depend.xml deleted file mode 100644 index 69a1e4f..0000000 --- a/test/resources/design/designfiles/staticfield2depend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.staticfield2depend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/staticfielddepend.xml b/test/resources/design/designfiles/staticfielddepend.xml deleted file mode 100644 index d477496..0000000 --- a/test/resources/design/designfiles/staticfielddepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.staticfielddepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/staticfinaldepend.xml b/test/resources/design/designfiles/staticfinaldepend.xml deleted file mode 100644 index a264547..0000000 --- a/test/resources/design/designfiles/staticfinaldepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.staticfinaldepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/superdepend.xml b/test/resources/design/designfiles/superdepend.xml deleted file mode 100644 index 153ee2b..0000000 --- a/test/resources/design/designfiles/superdepend.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.superdepend"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/warfailure.xml b/test/resources/design/designfiles/warfailure.xml deleted file mode 100644 index daf5368..0000000 --- a/test/resources/design/designfiles/warfailure.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.warfailure"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/designfiles/warsuccess.xml b/test/resources/design/designfiles/warsuccess.xml deleted file mode 100644 index 3e100e9..0000000 --- a/test/resources/design/designfiles/warsuccess.xml +++ /dev/null @@ -1,6 +0,0 @@ -<design> - -<package name="dummy" package="mod.dummy"/> -<package name="client" package="mod.warsuccess" depends="dummy"/> - -</design>
\ No newline at end of file diff --git a/test/resources/design/src/mod/arraydepend/ClassDependsOnArray.java b/test/resources/design/src/mod/arraydepend/ClassDependsOnArray.java deleted file mode 100644 index ed4b01c..0000000 --- a/test/resources/design/src/mod/arraydepend/ClassDependsOnArray.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 9, 2005 - */ -package mod.arraydepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnArray { - - public void something() { - Object[] o = new DummyClass[5]; - } -} diff --git a/test/resources/design/src/mod/arraydepend2/ClassDependsOnArray.java b/test/resources/design/src/mod/arraydepend2/ClassDependsOnArray.java deleted file mode 100644 index 4d65a7a..0000000 --- a/test/resources/design/src/mod/arraydepend2/ClassDependsOnArray.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 9, 2005 - */ -package mod.arraydepend2; - - - -/** - * - * @author dhiller - */ -public class ClassDependsOnArray { - - public void testArray() throws Exception { - Class c = String[].class; - } -} diff --git a/test/resources/design/src/mod/arraydepend3/ClassDependsOnArray.java b/test/resources/design/src/mod/arraydepend3/ClassDependsOnArray.java deleted file mode 100644 index 2ff6d67..0000000 --- a/test/resources/design/src/mod/arraydepend3/ClassDependsOnArray.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 9, 2005 - */ -package mod.arraydepend3; - -import mod.dummy.DummyClass; - - - -/** - * - * @author dhiller - */ -public class ClassDependsOnArray { - - public void testArray() throws Exception { - Class c = DummyClass[].class; - } -} diff --git a/test/resources/design/src/mod/castdepend/ClassDependsOnCast.java b/test/resources/design/src/mod/castdepend/ClassDependsOnCast.java deleted file mode 100644 index b6ad33a..0000000 --- a/test/resources/design/src/mod/castdepend/ClassDependsOnCast.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.castdepend; - -import mod.dummy.DummyInterface; - -/** - * - * @author dhiller - */ -public class ClassDependsOnCast { - - public void getSomething(Object obj) { - Object o = (DummyInterface)obj; - } -} diff --git a/test/resources/design/src/mod/catchdepend/ClassDependsOnCatch.java b/test/resources/design/src/mod/catchdepend/ClassDependsOnCatch.java deleted file mode 100644 index a103240..0000000 --- a/test/resources/design/src/mod/catchdepend/ClassDependsOnCatch.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.catchdepend; - -import mod.dummy.DummyRuntimeException; - -/** - * - * @author dhiller - */ -public class ClassDependsOnCatch { - - public void doNothing() { - try { - int x = 0; - int y = x+4; - } catch(DummyRuntimeException e) { - - } - } -} diff --git a/test/resources/design/src/mod/declarejavautil/ClassDependsOnJavaUtil.java b/test/resources/design/src/mod/declarejavautil/ClassDependsOnJavaUtil.java deleted file mode 100644 index 077da65..0000000 --- a/test/resources/design/src/mod/declarejavautil/ClassDependsOnJavaUtil.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 19, 2005 - */ -package mod.declarejavautil; - -import java.util.List; - -/** - * - * @author dhiller - */ -public class ClassDependsOnJavaUtil { - - public List list; -} diff --git a/test/resources/design/src/mod/declarejavax/ClassDependsOnJavax.java b/test/resources/design/src/mod/declarejavax/ClassDependsOnJavax.java deleted file mode 100644 index cd79675..0000000 --- a/test/resources/design/src/mod/declarejavax/ClassDependsOnJavax.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 19, 2005 - */ -package mod.declarejavax; - -import javax.swing.JButton; - -/** - * - * @author dhiller - */ -public class ClassDependsOnJavax { - - public JButton b = null; - -} diff --git a/test/resources/design/src/mod/dummy/DummyClass.java b/test/resources/design/src/mod/dummy/DummyClass.java deleted file mode 100644 index f2f48df..0000000 --- a/test/resources/design/src/mod/dummy/DummyClass.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.dummy; - -/** - * - * @author dhiller - */ -public class DummyClass { - - public static final String CONSTANT = "asdf"; - public static String staticField = "xxxx"; - - public static String returnSomething() { - return "Xxx"; - } -} diff --git a/test/resources/design/src/mod/dummy/DummyException.java b/test/resources/design/src/mod/dummy/DummyException.java deleted file mode 100644 index 3884fc1..0000000 --- a/test/resources/design/src/mod/dummy/DummyException.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.dummy; - -/** - * - * @author dhiller - */ -public class DummyException extends Exception { - -} diff --git a/test/resources/design/src/mod/dummy/DummyInterface.java b/test/resources/design/src/mod/dummy/DummyInterface.java deleted file mode 100644 index e7432fa..0000000 --- a/test/resources/design/src/mod/dummy/DummyInterface.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.dummy; - -/** - * - * @author dhiller - */ -public interface DummyInterface { - -} diff --git a/test/resources/design/src/mod/dummy/DummyRuntimeException.java b/test/resources/design/src/mod/dummy/DummyRuntimeException.java deleted file mode 100644 index 53cb35a..0000000 --- a/test/resources/design/src/mod/dummy/DummyRuntimeException.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.dummy; - -/** - * - * @author dhiller - */ -public class DummyRuntimeException extends RuntimeException { - -} diff --git a/test/resources/design/src/mod/fielddepend/ClassDependsOnField.java b/test/resources/design/src/mod/fielddepend/ClassDependsOnField.java deleted file mode 100644 index 226003b..0000000 --- a/test/resources/design/src/mod/fielddepend/ClassDependsOnField.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.fielddepend; - -import mod.dummy.DummyClass; - -/** - * This class depends on a field in another package. - * - * @author dhiller - */ -public class ClassDependsOnField { - - private DummyClass f; -} diff --git a/test/resources/design/src/mod/fieldrefdepend/ClassDependsOnReferenceInFieldDeclaration.java b/test/resources/design/src/mod/fieldrefdepend/ClassDependsOnReferenceInFieldDeclaration.java deleted file mode 100644 index 8329bfc..0000000 --- a/test/resources/design/src/mod/fieldrefdepend/ClassDependsOnReferenceInFieldDeclaration.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.fieldrefdepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnReferenceInFieldDeclaration { - - private Class c = DummyClass.class; - -} diff --git a/test/resources/design/src/mod/innerclassdepend/InnerClassDependsOnSuper.java b/test/resources/design/src/mod/innerclassdepend/InnerClassDependsOnSuper.java deleted file mode 100644 index ee882e5..0000000 --- a/test/resources/design/src/mod/innerclassdepend/InnerClassDependsOnSuper.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.innerclassdepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class InnerClassDependsOnSuper { - - private class Inner extends DummyClass { - - } -} diff --git a/test/resources/design/src/mod/instanceofdepend/ClassDependsOnInstanceOf.java b/test/resources/design/src/mod/instanceofdepend/ClassDependsOnInstanceOf.java deleted file mode 100644 index 55a78bb..0000000 --- a/test/resources/design/src/mod/instanceofdepend/ClassDependsOnInstanceOf.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.instanceofdepend; - -import mod.dummy.DummyInterface; - -/** - * - * @author dhiller - */ -public class ClassDependsOnInstanceOf { - - public void getSomething(Object o) { - int x = 0; - if(o instanceof DummyInterface) { - x = 4; - } - } -} diff --git a/test/resources/design/src/mod/interfacedepend/ClassDependsOnInterfaceMod2.java b/test/resources/design/src/mod/interfacedepend/ClassDependsOnInterfaceMod2.java deleted file mode 100644 index 6713b1c..0000000 --- a/test/resources/design/src/mod/interfacedepend/ClassDependsOnInterfaceMod2.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.interfacedepend; - -import mod.dummy.DummyInterface; - -/** - * This class depends on an interface in another package creating a dependency - * between packages. - * - * @author dhiller - */ -public class ClassDependsOnInterfaceMod2 implements DummyInterface { - -} diff --git a/test/resources/design/src/mod/localvardepend/ClassDependsOnLocalVar.java b/test/resources/design/src/mod/localvardepend/ClassDependsOnLocalVar.java deleted file mode 100644 index cd177da..0000000 --- a/test/resources/design/src/mod/localvardepend/ClassDependsOnLocalVar.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.localvardepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnLocalVar { - - public String doNothing() { - DummyClass c = null; - - return ""+c; - } -} diff --git a/test/resources/design/src/mod/localvarrefdepend/ClassDependsOnLocalVariableReference.java b/test/resources/design/src/mod/localvarrefdepend/ClassDependsOnLocalVariableReference.java deleted file mode 100644 index 8e77433..0000000 --- a/test/resources/design/src/mod/localvarrefdepend/ClassDependsOnLocalVariableReference.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.localvarrefdepend; - -import mod.dummy.DummyInterface; - -/** - * - * @author dhiller - */ -public class ClassDependsOnLocalVariableReference { - - public void doNothing() { - Class c = DummyInterface.class; - } -} diff --git a/test/resources/design/src/mod/newdepend/ClassDependsOnNew.java b/test/resources/design/src/mod/newdepend/ClassDependsOnNew.java deleted file mode 100644 index efcaa49..0000000 --- a/test/resources/design/src/mod/newdepend/ClassDependsOnNew.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.newdepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnNew { - - public void doNothing() { - new DummyClass(); - } -} diff --git a/test/resources/design/src/mod/newdepend2/ClassDependsOnNewInField.java b/test/resources/design/src/mod/newdepend2/ClassDependsOnNewInField.java deleted file mode 100644 index d76ade3..0000000 --- a/test/resources/design/src/mod/newdepend2/ClassDependsOnNewInField.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.newdepend2; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnNewInField { - - public Object o = new DummyClass(); -} diff --git a/test/resources/design/src/mod/nodebugoption/ClassDependsOnLocalVar.java b/test/resources/design/src/mod/nodebugoption/ClassDependsOnLocalVar.java deleted file mode 100644 index bb65e63..0000000 --- a/test/resources/design/src/mod/nodebugoption/ClassDependsOnLocalVar.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.nodebugoption; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnLocalVar { - - public void doSomething() { - DummyClass c = null; - //without debug option enabled, the type DummyClass is lost so we - //must fail with the error saying class wasn't compiled with -g option - //enabled in javac. - } -} diff --git a/test/resources/design/src/mod/paramdepend/ClassDependsOnParameter.java b/test/resources/design/src/mod/paramdepend/ClassDependsOnParameter.java deleted file mode 100644 index 12866b1..0000000 --- a/test/resources/design/src/mod/paramdepend/ClassDependsOnParameter.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.paramdepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnParameter { - - public void setSomething(String dummy, DummyClass c) { - - } -} diff --git a/test/resources/design/src/mod/passlocaldepend/ClassDependsOnClassInSamePackage.java b/test/resources/design/src/mod/passlocaldepend/ClassDependsOnClassInSamePackage.java deleted file mode 100644 index a2ae720..0000000 --- a/test/resources/design/src/mod/passlocaldepend/ClassDependsOnClassInSamePackage.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.passlocaldepend; - -/** - * - * @author dhiller - */ -public class ClassDependsOnClassInSamePackage { - - public void doSomething(FakeClass c) { - - } -} diff --git a/test/resources/design/src/mod/passlocaldepend/FakeClass.java b/test/resources/design/src/mod/passlocaldepend/FakeClass.java deleted file mode 100644 index ed35025..0000000 --- a/test/resources/design/src/mod/passlocaldepend/FakeClass.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.passlocaldepend; - -/** - * - * @author dhiller - */ -public class FakeClass { - -} diff --git a/test/resources/design/src/mod/putstatic/ClassDependsOnNothing.java b/test/resources/design/src/mod/putstatic/ClassDependsOnNothing.java deleted file mode 100644 index fbedddf..0000000 --- a/test/resources/design/src/mod/putstatic/ClassDependsOnNothing.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.putstatic; - - -/** - * - * @author dhiller - */ -public class ClassDependsOnNothing { - - private static String s; - public static void setJarLocator(String l) { - s = l; - } -} diff --git a/test/resources/design/src/mod/recursion/client/ClassDependsOnSubPackage.java b/test/resources/design/src/mod/recursion/client/ClassDependsOnSubPackage.java deleted file mode 100644 index ce95d9c..0000000 --- a/test/resources/design/src/mod/recursion/client/ClassDependsOnSubPackage.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.recursion.client; - -import mod.recursion.rec.a.FakeClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnSubPackage { - - public FakeClass getSoemthing() { - return null; - } -} diff --git a/test/resources/design/src/mod/recursion/rec/a/FakeClass.java b/test/resources/design/src/mod/recursion/rec/a/FakeClass.java deleted file mode 100644 index ada6615..0000000 --- a/test/resources/design/src/mod/recursion/rec/a/FakeClass.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.recursion.rec.a; - -/** - * - * @author dhiller - */ -public class FakeClass { - -} diff --git a/test/resources/design/src/mod/recursion2/dependency/Dependency.java b/test/resources/design/src/mod/recursion2/dependency/Dependency.java deleted file mode 100644 index dc9b594..0000000 --- a/test/resources/design/src/mod/recursion2/dependency/Dependency.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.recursion2.dependency; - -/** - * - * @author dhiller - */ -public class Dependency { - -} diff --git a/test/resources/design/src/mod/recursion2/rec/client/SubpackageClassDependsOnPackage.java b/test/resources/design/src/mod/recursion2/rec/client/SubpackageClassDependsOnPackage.java deleted file mode 100644 index 57dc96a..0000000 --- a/test/resources/design/src/mod/recursion2/rec/client/SubpackageClassDependsOnPackage.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 16, 2005 - */ -package mod.recursion2.rec.client; - -import mod.recursion2.dependency.Dependency; - -/** - * - * @author dhiller - */ -public class SubpackageClassDependsOnPackage { - - public Dependency doNothing() { - return null; - } -} diff --git a/test/resources/design/src/mod/recursion3/client/SubpackageClassDependsOnSubpackage.java b/test/resources/design/src/mod/recursion3/client/SubpackageClassDependsOnSubpackage.java deleted file mode 100644 index 64dd1ce..0000000 --- a/test/resources/design/src/mod/recursion3/client/SubpackageClassDependsOnSubpackage.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 16, 2005 - */ -package mod.recursion3.client; - -import mod.recursion3.svc.DependencyClass; - -/** - * - * @author dhiller - */ -public class SubpackageClassDependsOnSubpackage { - - public void doSomething(DependencyClass c) { - - } -} diff --git a/test/resources/design/src/mod/recursion3/svc/DependencyClass.java b/test/resources/design/src/mod/recursion3/svc/DependencyClass.java deleted file mode 100644 index e3bc462..0000000 --- a/test/resources/design/src/mod/recursion3/svc/DependencyClass.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 16, 2005 - */ -package mod.recursion3.svc; - -/** - * - * @author dhiller - */ -public class DependencyClass { - -} diff --git a/test/resources/design/src/mod/returnvaldepend/ClassDependsOnReturnValue.java b/test/resources/design/src/mod/returnvaldepend/ClassDependsOnReturnValue.java deleted file mode 100644 index 61f00ae..0000000 --- a/test/resources/design/src/mod/returnvaldepend/ClassDependsOnReturnValue.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.returnvaldepend; - -import mod.dummy.DummyInterface; - -/** - * - * @author dhiller - */ -public class ClassDependsOnReturnValue { - - public DummyInterface getSomething() { - return null; - } -} diff --git a/test/resources/design/src/mod/signatureexceptiondepend/ClassDependsOnExceptionInMethodSignature.java b/test/resources/design/src/mod/signatureexceptiondepend/ClassDependsOnExceptionInMethodSignature.java deleted file mode 100644 index a235e12..0000000 --- a/test/resources/design/src/mod/signatureexceptiondepend/ClassDependsOnExceptionInMethodSignature.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.signatureexceptiondepend; - -import mod.dummy.DummyException; - -/** - * - * @author dhiller - */ -public class ClassDependsOnExceptionInMethodSignature { - - public String doNothing() throws DummyException { - return null; - } -} diff --git a/test/resources/design/src/mod/staticdepend/ClassDependsOnStatic.java b/test/resources/design/src/mod/staticdepend/ClassDependsOnStatic.java deleted file mode 100644 index 60b1f53..0000000 --- a/test/resources/design/src/mod/staticdepend/ClassDependsOnStatic.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.staticdepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnStatic { - - public String getSomething() { - return DummyClass.returnSomething(); - } -} diff --git a/test/resources/design/src/mod/staticfield2depend/ClassDependsOnStaticField.java b/test/resources/design/src/mod/staticfield2depend/ClassDependsOnStaticField.java deleted file mode 100644 index 6d2a587..0000000 --- a/test/resources/design/src/mod/staticfield2depend/ClassDependsOnStaticField.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 9, 2005 - */ -package mod.staticfield2depend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnStaticField { - - public static DummyClass x = null; - - -} diff --git a/test/resources/design/src/mod/staticfielddepend/ClassDependsOnStaticField.java b/test/resources/design/src/mod/staticfielddepend/ClassDependsOnStaticField.java deleted file mode 100644 index 67f35db..0000000 --- a/test/resources/design/src/mod/staticfielddepend/ClassDependsOnStaticField.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 9, 2005 - */ -package mod.staticfielddepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnStaticField { - - public void doNothing() { - String s = DummyClass.staticField; - } -} diff --git a/test/resources/design/src/mod/staticfinaldepend/ClassDependsOnConstant.java b/test/resources/design/src/mod/staticfinaldepend/ClassDependsOnConstant.java deleted file mode 100644 index 6273c9a..0000000 --- a/test/resources/design/src/mod/staticfinaldepend/ClassDependsOnConstant.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 9, 2005 - */ -package mod.staticfinaldepend; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class ClassDependsOnConstant { - - public void doNothing() { - String s = ""+DummyClass.CONSTANT; - } -} diff --git a/test/resources/design/src/mod/superdepend/ClassDependsOnSuperMod2.java b/test/resources/design/src/mod/superdepend/ClassDependsOnSuperMod2.java deleted file mode 100644 index 880f757..0000000 --- a/test/resources/design/src/mod/superdepend/ClassDependsOnSuperMod2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.superdepend; - -import mod.dummy.DummyClass; - -/** - * This class depends on a superclass in another package creating a dependency - * between packages. - * @author dhiller - */ -public class ClassDependsOnSuperMod2 extends DummyClass { - -} diff --git a/test/resources/design/src/mod/temp/Factory.java b/test/resources/design/src/mod/temp/Factory.java deleted file mode 100644 index a05622e..0000000 --- a/test/resources/design/src/mod/temp/Factory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Jan 13, 2005 - */ -package mod.temp; - -import mod.dummy.DummyClass; - -/** - * - * @author dhiller - */ -public class Factory { - - public static DummyClass create() { - return new DummyClass(); - } -} diff --git a/test/resources/design/src/mod/warfailure/ClassDependsOnSuperMod2.java b/test/resources/design/src/mod/warfailure/ClassDependsOnSuperMod2.java deleted file mode 100644 index 3ee27c7..0000000 --- a/test/resources/design/src/mod/warfailure/ClassDependsOnSuperMod2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.warfailure; - -import mod.dummy.DummyClass; - -/** - * This class depends on a superclass in another package creating a dependency - * between packages. - * @author dhiller - */ -public class ClassDependsOnSuperMod2 extends DummyClass { - -} diff --git a/test/resources/design/src/mod/warsuccess/ClassDependsOnSuperMod2.java b/test/resources/design/src/mod/warsuccess/ClassDependsOnSuperMod2.java deleted file mode 100644 index da5e8a2..0000000 --- a/test/resources/design/src/mod/warsuccess/ClassDependsOnSuperMod2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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. - */ -/* - * Created on Dec 29, 2004 - */ -package mod.warsuccess; - -import mod.dummy.DummyClass; - -/** - * This class depends on a superclass in another package creating a dependency - * between packages. - * @author dhiller - */ -public class ClassDependsOnSuperMod2 extends DummyClass { - -} diff --git a/test/resources/design/verifydesign.xml b/test/resources/design/verifydesign.xml deleted file mode 100644 index 53d7d17..0000000 --- a/test/resources/design/verifydesign.xml +++ /dev/null @@ -1,440 +0,0 @@ -<project name="test_verifydesign" basedir="." default="cleanup"> - <property name="output" value="build"/> - <property name="classes" value="${output}/classes"/> - <property name="jardir" value="${output}/jar"/> - <property name="jar" value="${jardir}/test.jar"/> - <property name="war" value="${jardir}/test.war"/> - <property name="src" value="src"/> - <property name="mod" value="mod"/> - <property name="dummy" value="dummy"/> - <property name="designs" value="designfiles"/> - <property name="webxml" value="web.xml"/> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <target name="cleanup"> - <delete quiet="yes" dir="${output}"/> - </target> - - <target name="init"> - <mkdir dir="${jardir}"/> - </target> - - <target name="templateTest"> - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${dummy}/**"/> - <include name="${mod}/${package.under.test}/**"/> - </javac> - <jar destfile="${jar}" basedir="${classes}"/> - </target> - - <target name="templateWar"> - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${dummy}/**"/> - <include name="${mod}/${package.under.test}/**"/> - </javac> - - <war destfile="${war}" webxml="${webxml}"> - <classes dir="${classes}"/> - </war> - </target> - - <target name="testArrayDepend" depends="init"> - <property name="package" value="arraydepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testArrayDepend2" depends="init"> - <property name="package" value="arraydepend2"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testArrayDepend3" depends="init"> - <property name="package" value="arraydepend3"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testBadXML" depends="init"> - <property name="package" value="badxml"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testCastDepend" depends="init"> - <property name="package" value="castdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testCatchDepend" depends="init"> - <property name="package" value="catchdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testClassFiles" depends="init"> - <property name="package" value="castdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign design="${designs}/${package}.xml"> - <path> - <fileset dir="${classes}"> - <include name="**/*.class"/> - </fileset> - </path> - </verifydesign> - </target> - - <target name="testDeclareJavaUtil" depends="init"> - <property name="package" value="declarejavautil"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testDeclareJavaUtilFail" depends="init"> - <property name="package" value="declarejavautil"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}fail.xml"/> - </target> - - <target name="testDeclareJavax" depends="init"> - <property name="package" value="declarejavax"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testDeclareJavaxPass" depends="init"> - <property name="package" value="declarejavax"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}pass.xml"/> - </target> - - <target name="testFieldDepend" depends="init"> - <property name="package" value="fielddepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testFieldRefDepend" depends="init"> - <property name="package" value="fieldrefdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testInnerClassDepend" depends="init"> - <property name="package" value="innerclassdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testInstanceOfDepend" depends="init"> - <property name="package" value="instanceofdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testInterfaceDepend" depends="init"> - <property name="package" value="interfacedepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testLocalVarDepend" depends="init"> - <property name="package" value="localvardepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testLocalVarRefDepend" depends="init"> - <property name="package" value="localvarrefdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testMissingAttribute" depends="init"> - <property name="package" value="missingattribute"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testMultipleErrors" depends="init"> - <property name="package" value="multipleerrors"/> - - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${dummy}/**"/> - <include name="${mod}/arraydepend/**"/> - <include name="${mod}/castdepend/**"/> - <include name="${mod}/catchdepend/**"/> - </javac> - <jar destfile="${jar}" basedir="${classes}"/> - - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testNewDepend" depends="init"> - <property name="package" value="newdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testNewDepend2" depends="init"> - <property name="package" value="newdepend2"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testNoDebugOption" depends="init"> - <property name="package" value="nodebugoption"/> - - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${dummy}/**"/> - </javac> - <javac srcdir="${src}" debug="false" destdir="${classes}"> - <include name="${mod}/${package}/**"/> - </javac> - - <jar destfile="${jar}" basedir="${classes}"/> - - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testNoJar" depends="init"> - <property name="package" value="nojar"/> - - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testParamDepend" depends="init"> - <property name="package" value="paramdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testPassLocalDepend" depends="init"> - <property name="package" value="passlocaldepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testPathElementLocation" depends="init"> - <property name="package" value="putstatic"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign design="${designs}/${package}.xml"> - <path> - <pathelement location="${classes}"/> - </path> - </verifydesign> - </target> - - <target name="testPathElementPath" depends="init"> - <property name="package" value="pathelementpath"/> - <property name="classes2" value="${output}/classes2"/> - <property name="classes3" value="${output}/classes3"/> - <mkdir dir="${classes}"/> - <mkdir dir="${classes2}"/> - <mkdir dir="${classes3}"/> - - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${dummy}/**"/> - </javac> - - <javac srcdir="${src}" debug="true" destdir="${classes2}" classpath="${classes}"> - <include name="${mod}/putstatic/**"/> - </javac> - - <javac srcdir="${src}" debug="true" destdir="${classes3}" classpath="${classes}"> - <include name="${mod}/arraydepend2/**"/> - </javac> - - <jar destfile="${jar}" basedir="${classes3}"/> - - <verifydesign design="${designs}/${package}.xml"> - <path> - <pathelement path="${classes2}:${jar}:${classes}"/> - </path> - </verifydesign> - </target> - - <target name="testPutStatic" depends="init"> - <property name="package" value="putstatic"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testRecursion" depends="init"> - <property name="package" value="recursion"/> - - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${package}/**"/> - </javac> - - <jar destfile="${jar}" basedir="${classes}"/> - - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testRecursion2" depends="init"> - <property name="package" value="recursion2"/> - - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${package}/**"/> - </javac> - - <jar destfile="${jar}" basedir="${classes}"/> - - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testRecursion3" depends="init"> - <property name="package" value="recursion3"/> - - <delete dir="${classes}"/> - <mkdir dir="${classes}"/> - <javac srcdir="${src}" debug="true" destdir="${classes}"> - <include name="${mod}/${package}/**"/> - </javac> - - <jar destfile="${jar}" basedir="${classes}"/> - - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testReturnValDepend" depends="init"> - <property name="package" value="returnvaldepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testSignatureExceptionDepend" depends="init"> - <property name="package" value="signatureexceptiondepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testStaticDepend" depends="init"> - <property name="package" value="staticdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testStaticField2Depend" depends="init"> - <property name="package" value="staticfield2depend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testStaticFieldDepend" depends="init"> - <property name="package" value="staticfielddepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testStaticFinalDepend" depends="init"> - <property name="package" value="staticfinaldepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml"/> - </target> - - <target name="testSuperDepend" depends="init"> - <property name="package" value="superdepend"/> - <antcall target="templateTest"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${jar}" design="${designs}/${package}.xml" - deletefiles="true"/> - </target> - - <target name="testWarSuccess" depends="init"> - <property name="package" value="warsuccess"/> - <antcall target="templateWar"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${war}" design="${designs}/${package}.xml"/> - </target> - - <target name="testWarFailure" depends="init"> - <property name="package" value="warfailure"/> - <antcall target="templateWar"> - <param name="package.under.test" value="${package}"/> - </antcall> - <verifydesign jar="${war}" design="${designs}/${package}.xml"/> - </target> -</project> diff --git a/test/resources/design/web.xml b/test/resources/design/web.xml deleted file mode 100644 index e69de29..0000000 --- a/test/resources/design/web.xml +++ /dev/null diff --git a/test/resources/logic/antcallbacktest.xml b/test/resources/logic/antcallbacktest.xml deleted file mode 100644 index 7f165c8..0000000 --- a/test/resources/logic/antcallbacktest.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0"?> - -<project name="antcallbacktest" basedir="." default="test1"> - <description> - test build file for the AntCallBack task - </description> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - - <target name="test1"> - <antcallback target="setProperty" return="prop1"/> - </target> - - <target name="test2"> - <antcallback target="setProperties" return="prop1,prop2,prop3"/> - </target> - - <target name="test3"> - <antcallback target="setProperties" return="prop1, prop2, prop3"/> - </target> - - <target name="test4"> - <antcallback target="setTwoProperties" return="prop1, prop2, prop3"/> - </target> - - <target name="test5"> - <!-- the beauty of unit testing is this test for checking that a property - won't get overwritten also revealed that params weren't supported. - AntCallBack is actually based on the ant task, not antcall. --> - <antcallback target="setProperties" return="prop1, prop2, prop3"> - <param name="prop1" value="blah"/> - </antcallback> - </target> - - <target name="setProperty"> - <property name="prop1" value="prop1"/> - </target> - - <target name="setTwoProperties"> - <property name="prop2" value="prop2"/> - <property name="prop3" value="prop3"/> - </target> - - <target name="setProperties"> - <property name="prop1" value="prop1"/> - <property name="prop2" value="prop2"/> - <property name="prop3" value="prop3"/> - </target> - - <target name="setNoProperties"/> -</project> diff --git a/test/resources/logic/asserttest.xml b/test/resources/logic/asserttest.xml deleted file mode 100644 index acce588..0000000 --- a/test/resources/logic/asserttest.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0"?> - -<project name="asserttest" basedir="." default="test1"> - <description> - test build file for the Assert task - </description> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - <property name="ant.enable.asserts" value="true"/> - - <target name="test1"> - <property name="testprop" value="true"/> - <assert> - <isset property="testprop"/> - </assert> - <assert> - <istrue value="${testprop}" /> - </assert> - </target> - - <target name="test2"> - <assert name="testprop"/> - </target> - - <target name="test3"> - <property name="testprop" value="true"/> - <assert name="testprop" value="12"/> - </target> - - <!-- test boolean conditions --> - <target name="test4"> - <assert> - <isgreaterthan arg1="6.02" arg2="4"/> - </assert> - <assert> - <isgreaterthan arg1="Many" arg2="Less"/> - </assert> - </target> - <target name="test5"> - <assert> - <islessthan arg1="6.02" arg2="23.456"/> - </assert> - <assert> - <islessthan arg1="least" arg2="most"/> - </assert> - </target> - <target name="test6"> - <property name="testprop" value="false"/> - <assert> - <ispropertyfalse property="testprop"/> - </assert> - </target> - <target name="test7"> - <property name="testprop" value="no"/> - <assert> - <ispropertytrue property="testprop"/> - </assert> - </target> - <target name="test8"> - <property name="testprop" value="yes"/> - <assert> - <ispropertytrue property="testprop"/> - </assert> - </target> - <target name="test9"> - <property name="testprop" value="on"/> - <assert> - <ispropertyfalse property="testprop"/> - </assert> - </target> - -</project> diff --git a/test/resources/logic/for.xml b/test/resources/logic/for.xml deleted file mode 100644 index d4a25da..0000000 --- a/test/resources/logic/for.xml +++ /dev/null @@ -1,24 +0,0 @@ -<project> - <target name="init"> - <taskdef resource="net/sf/antcontrib/antlib.xml"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="loop" depends="init"> - <for param="i" end="10"> - <sequential> - <echo>i is @{i}</echo> - </sequential> - </for> - </target> - - <target name="step" depends="init"> - <for param="i" end="0" begin="10" step="-2"> - <sequential> - <echo>i is @{i}</echo> - </sequential> - </for> - </target> - -</project> diff --git a/test/resources/logic/foreach.xml b/test/resources/logic/foreach.xml deleted file mode 100644 index 00e8c8a..0000000 --- a/test/resources/logic/foreach.xml +++ /dev/null @@ -1,104 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="teardown"> - <delete dir="foreachtest"/> - </target> - - <target name="echo"> - <echo>Called with param: ${param}</echo> - </target> - - <target name="convert-bar" unless="param"> - <property name="param" refid="bar"/> - </target> - - <target name="echoFilename" depends="convert-bar"> - <basename file="${param}" property="param2"/> - <echo>Called with param: ${param2}</echo> - </target> - - <target name="simpleList" depends="setup"> - <foreach list="1,2,3" target="echo" param="param"/> - </target> - - <target name="delimiter" depends="setup"> - <foreach list="1/2/3" target="echo" param="param" delimiter="/"/> - </target> - - <target name="fileset" depends="setup"> - <mkdir dir="foreachtest"/> - <touch file="foreachtest/1"/> - <touch file="foreachtest/2"/> - <touch file="foreachtest/3"/> - <foreach target="echoFilename" param="param"> - <fileset dir="foreachtest"/> - </foreach> - </target> - - <target name="filesetAndList" depends="setup"> - <mkdir dir="foreachtest"/> - <touch file="foreachtest/3"/> - <foreach list="1,2" target="echoFilename" param="param"> - <fileset dir="foreachtest"/> - </foreach> - </target> - - <target name="noList" depends="setup"> - <foreach target="echo" param="param"/> - </target> - - <target name="noTarget" depends="setup"> - <foreach list="1,2,3" param="param"/> - </target> - - <target name="noParam" depends="setup"> - <foreach list="1,2,3" target="echo"/> - </target> - - <target name="nestedParam" depends="setup"> - <foreach list="1" target="echo" param="who-cares"> - <param name="param" value="rincewind"/> - </foreach> - </target> - - <target name="nestedReference" depends="setup"> - <path id="foo"> - <pathelement location="twoflower"/> - </path> - <foreach list="1" target="echoFilename" param="who-cares"> - <reference refid="foo" torefid="bar"/> - </foreach> - </target> - - <target name="path" depends="setup"> - <mkdir dir="foreachtest"/> - <touch file="foreachtest/1"/> - <touch file="foreachtest/2"/> - <touch file="foreachtest/3"/> - <foreach target="echoFilename" param="param"> - <path> - <fileset dir="foreachtest"/> - </path> - </foreach> - </target> - - <target name="pathAndList" depends="setup"> - <mkdir dir="foreachtest"/> - <touch file="foreachtest/3"/> - <foreach list="1,2" target="echoFilename" param="param"> - <path> - <fileset dir="foreachtest"/> - </path> - </foreach> - </target> - -</project>
\ No newline at end of file diff --git a/test/resources/logic/if.xml b/test/resources/logic/if.xml deleted file mode 100644 index f9c23c4..0000000 --- a/test/resources/logic/if.xml +++ /dev/null @@ -1,146 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="noCondition" depends="setup"> - <if> - <then> - <echo>Foo</echo> - </then> - </if> - </target> - - <target name="twoConditions" depends="setup"> - <if> - <isset property="1"/> - <isset property="2"/> - <then> - <echo>Foo</echo> - </then> - </if> - </target> - - <target name="nothingToDo" depends="setup"> - <if> - <isset property="antcontrib.jar"/> - </if> - </target> - - <target name="twoThens" depends="setup"> - <if> - <isset property="antcontrib.jar"/> - <then/> - <then/> - </if> - </target> - - <target name="twoElses" depends="setup"> - <if> - <isset property="antcontrib.jar"/> - <else/> - <else/> - </if> - </target> - - <target name="normalOperation" depends="setup"> - <if> - <isset property="antcontrib.jar"/> - <then> - <echo>In then</echo> - <property name="inner" value="some value"/> - <echo>${inner}</echo> - </then> - <else> - <echo>In else</echo> - </else> - </if> - </target> - - <target name="normalOperation2" depends="setup"> - <if> - <not> - <isset property="antcontrib.jar"/> - </not> - <then> - <echo>In then</echo> - </then> - <else> - <echo>In else</echo> - </else> - </if> - </target> - - <target name="noConditionInElseif" depends="setup"> - <if> - <isset property="1"/> - <elseif> - <then> - <echo>Foo</echo> - </then> - </elseif> - </if> - </target> - - <target name="twoConditionsInElseif" depends="setup"> - <if> - <isset property="1"/> - <elseif> - <isset property="1"/> - <isset property="2"/> - <then> - <echo>Foo</echo> - </then> - </elseif> - </if> - </target> - - <target name="normalOperationElseif" depends="setup"> - <if> - <not> - <isset property="antcontrib.jar"/> - </not> - <then> - <echo>In then</echo> - </then> - <elseif> - <isset property="antcontrib.jar"/> - <then> - <echo>In elseif</echo> - </then> - </elseif> - <else> - <echo>In else-branch</echo> - </else> - </if> - </target> - - <target name="normalOperationElseif2" depends="setup"> - <if> - <not> - <isset property="antcontrib.jar"/> - </not> - <then> - <echo>In then</echo> - </then> - <elseif> - <not> - <isset property="antcontrib.jar"/> - </not> - <then> - <echo>In elseif</echo> - </then> - </elseif> - <else> - <echo>In else-branch</echo> - </else> - </if> - </target> - -</project> diff --git a/test/resources/logic/limittest.xml b/test/resources/logic/limittest.xml deleted file mode 100644 index bd3917f..0000000 --- a/test/resources/logic/limittest.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0"?> - -<project name="limittest" basedir="." default="test1"> - <description> - test build file for the Limit task - </description> - - <target name="init"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="test1" depends="init"> - <!-- should stop 'sleep' task, no failure message --> - <limit maxwait="1"> - <sleep seconds="5"/> - <echo>_failed_</echo> - <fail/> - </limit> - </target> - - <property name="ant.enable.asserts" value="true"/> - <target name="test2" depends="init"> - <!-- should not stop 'sleep' task, should print out '_passed_' --> - <stopwatch name="limit"/> - <limit maxwait="5"> - <sleep seconds="1"/> - <echo>_passed_</echo> - </limit> - <stopwatch name="limit" action="total"/> - <assert message="Too much time."> - <bool> - <islessthan arg1="${limit}" arg2="2"/> - </bool> - </assert> - </target> - - <target name="test3" depends="init"> - <!-- test failonerror attribute, build should fail --> - <limit maxwait="3" failonerror="true"> - <fail message="_failed_"/> - </limit> - </target> - - <target name="test4" depends="init"> - <!-- test failonerror attribute, build should not fail --> - <limit maxwait="3"> - <fail message="_failed_"/> - </limit> - </target> - - <target name="test5" depends="init"> - <limit maxwait="1" unit="minute"> - <sleep seconds="65"/> - </limit> - </target> - - <target name="test6" depends="init"> - <limit seconds="6"> - <sleep seconds="7"/> - </limit> - </target> - -</project> diff --git a/test/resources/logic/outofdate.xml b/test/resources/logic/outofdate.xml deleted file mode 100644 index 8442152..0000000 --- a/test/resources/logic/outofdate.xml +++ /dev/null @@ -1,155 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <target name="cleanup"> - <delete quiet="yes" dir="targets"/> - <delete quiet="yes" dir="sources"/> - </target> - - <target name="init"> - <mkdir dir="targets"/> - <mkdir dir="sources"/> - - <touch file="sources/s1" millis="100000"/> - <touch file="targets/t1" millis="100"/> - <touch file="targets/t2" millis="1000000"/> - <path id="sources" path="sources/s1"/> - <path id="targets"> - <fileset dir="targets"/> - </path> - </target> - - <target name="simple" depends="init"> - <outofdate> - <sourcefiles refid="sources"/> - <targetfiles refid="targets"/> - <sequential> - <property name="simple.called" value=""/> - </sequential> - </outofdate> - <fail unless="simple.called">Simple seq not triggered</fail> - </target> - - <target name="verbose" depends="init"> - <outofdate verbose="true"> - <sourcefiles refid="sources"/> - <targetfiles refid="targets"/> - </outofdate> - </target> - - <target name="delete" depends="init"> - <outofdate> - <sourcefiles refid="sources"/> - <targetfiles refid="targets"/> - <deletetargets/> - </outofdate> - <if> - <available file="targets/t1"/> - <then> - <fail>delete failed</fail> - </then> - </if> - <if> - <available file="targets/t2"/> - <else> - <fail>delete too much</fail> - </else> - </if> - </target> - - <target name="delete-all" depends="init"> - <outofdate> - <sourcefiles refid="sources"/> - <targetfiles refid="targets"/> - <deletetargets all="true"/> - </outofdate> - <if> - <available file="targets/t1"/> - <then> - <fail>delete failed</fail> - </then> - </if> - <if> - <available file="targets/t2"/> - <then> - <fail>delete all failed</fail> - </then> - </if> - </target> - - <target name="delete-quiet"> - <outofdate> - <sourcefiles refid="sources"/> - <targetfiles refid="targets"/> - <deletetargets quiet="yes"/> - </outofdate> - </target> - - <target name="outofdate.init"> - <!-- generated --> - <mkdir dir="outofdate/gen/1/2/3"/> - <touch file="outofdate/gen/index.done"/> - <touch file="outofdate/gen/1/2/file.done"/> - <touch file="outofdate/gen/1/done.c"/> - <touch file="outofdate/gen/1/done.h"/> - <touch file="outofdate/gen/1/partial.c"/> - - <!-- sources --> - <mkdir dir="outofdate/source/1/2/3"/> - <touch file="outofdate/source/newer.text"/> - <touch file="outofdate/source/1/2/file.notdone"/> - <touch file="outofdate/source/1/2/file.done"/> - <touch file="outofdate/source/1/done.y"/> - <touch file="outofdate/source/1/partial.y"/> - - </target> - - <target name="outofdate.test" depends="outofdate.init"> - <outofdate - outputsources="outofdate.sources" - outputtargets="outofdate.targets" - alltargets="outofdate.alltargets" - outputsourcespath="outofdate.sources.path" - outputtargetspath="outofdate.targets.path" - > - <sourcefiles> - <fileset dir="outofdate/source"/> - <pathelement path="outofdate.xml"/> - </sourcefiles> - <targetfiles path="outofdate/gen/index.done"/> - <mapper type="glob" from="outofdate/source/1/2/*" - to="outofdate/gen/1/2/*"/> - <mapper type="glob" - from="outofdate/source/*.y" - to="outofdate/gen/*.c"/> - <mapper type="glob" - from="outofdate/source/*.y" - to="outofdate/gen/*.h"/> - <mapper type="glob" - from="outofdate/source/newer.text" - to="outofdate.xml"/> - <sequential> - <echo message="outofdate triggered"/> - </sequential> - </outofdate> - <delete dir="outofdate"/> - </target> - - <target name="empty-sources" depends="init"> - <outofdate> - <sourcefiles/> - <targetfiles path="THIS IS NOT PRESENT"/> - <sequential> - <property name="empty-sources.called" value=""/> - </sequential> - </outofdate> - <fail unless="empty-sources.called">Empty sources seq not triggered</fail> - </target> - -</project> diff --git a/test/resources/logic/relentless.xml b/test/resources/logic/relentless.xml deleted file mode 100644 index db25f6b..0000000 --- a/test/resources/logic/relentless.xml +++ /dev/null @@ -1,55 +0,0 @@ -<project name="relentless unit tests" default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="teardown"> - <delete dir="relentless"/> - </target> - - <target name="echo"> - <echo>Called with param: ${param}</echo> - </target> - - <target name="failTask" depends="setup" description="2 tasks should fail" > - <relentless> - <antcall target="echo" > - <param name="param" value="1" /> - </antcall> - <fail message="This task has failed." /> - <antcall target="echo" > - <param name="param" value="3" /> - </antcall> - <fail message="This task has failed as well." /> - </relentless> - </target> - - <target name="simpleTasks" depends="setup"> - <relentless> - <antcall target="echo" > - <param name="param" value="1" /> - </antcall> - <antcall target="echo" > - <param name="param" value="2" /> - </antcall> - <antcall target="echo" > - <param name="param" value="3" /> - </antcall> - <antcall target="echo" > - <param name="param" value="4" /> - </antcall> - </relentless> - </target> - - <target name="noTasks" depends="setup"> - <relentless> - </relentless> - </target> - -</project> diff --git a/test/resources/logic/switch.xml b/test/resources/logic/switch.xml deleted file mode 100644 index fbf8bef..0000000 --- a/test/resources/logic/switch.xml +++ /dev/null @@ -1,87 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="noValue" depends="setup"> - <switch/> - </target> - - <target name="noChildren" depends="setup"> - <switch value="foo"/> - </target> - - <target name="twoDefaults" depends="setup"> - <switch value="foo"> - <default/> - <default/> - </switch> - </target> - - <target name="noMatch" depends="setup"> - <switch value="foo"> - <case value="bar"/> - </switch> - </target> - - <target name="caseNoValue" depends="setup"> - <switch value="foo"> - <case/> - </switch> - </target> - - <target name="testDefault" depends="setup"> - <switch value="foo"> - <case value="bar"> - <echo>In case</echo> - </case> - <default> - <echo>In default</echo> - <property name="inner" value="baz"/> - <echo>${inner}</echo> - </default> - </switch> - </target> - - <target name="testCase" depends="setup"> - <switch value="foo"> - <case value="foo"> - <echo>In case</echo> - <property name="inner" value="baz"/> - <echo>${inner}</echo> - </case> - <default> - <echo>In default</echo> - </default> - </switch> - </target> - - <target name="testCaseSensitive" depends="setup"> - <switch value="FOO"> - <case value="foo"> - <echo>In case</echo> - </case> - <default> - <echo>In default</echo> - </default> - </switch> - </target> - - <target name="testCaseInSensitive" depends="setup"> - <switch value="FOO" caseinsensitive="true"> - <case value="foo"> - <echo>In case</echo> - </case> - <default> - <echo>In default</echo> - </default> - </switch> - </target> - -</project> diff --git a/test/resources/logic/throw.xml b/test/resources/logic/throw.xml deleted file mode 100644 index 0bea062..0000000 --- a/test/resources/logic/throw.xml +++ /dev/null @@ -1,15 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="useRefid" depends="setup"> - <throw refid="testref"/> - </target> -</project>
\ No newline at end of file diff --git a/test/resources/logic/timestampselector.xml b/test/resources/logic/timestampselector.xml deleted file mode 100644 index dd92eb3..0000000 --- a/test/resources/logic/timestampselector.xml +++ /dev/null @@ -1,76 +0,0 @@ -<project default="init"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <property name="test.dir" value="timestampselector"/> - <property name="test.file1" location="${test.dir}/file1.txt" /> - <property name="test.file2" location="${test.dir}/file2.txt" /> - <property name="test.dir1" location="${test.dir}/dir1" /> - <property name="test.dir2" location="${test.dir}/dir2" /> - - <fileset id="test.files" dir="${test.dir}"> - <include name="*.txt" /> - </fileset> - - <path id="test.files.path"> - <fileset refid="test.files" /> - </path> - - <dirset id="test.dirs" dir="${test.dir}"> - <include name="dir*" /> - </dirset> - - <path id="test.dirs.path"> - <dirset refid="test.dirs" /> - </path> - - <target name="init"> - <delete quiet ="yes" dir="${test.dir}"/> - <mkdir dir="${test.dir}"/> - <touch file="${test.dir}/file1.txt" /> - <touch file="${test.dir}/file2.txt" /> - <mkdir dir="${test.dir}/dir1"/> - <mkdir dir="${test.dir}/dir2"/> - </target> - - <target name="teardown"> - <delete quiet="yes" dir="${test.dir}" /> - </target> - - <target name="filestamp.fl" depends="init"> - <timestampselector property="latest.fl.tstamp"> - <path> - <fileset refid="test.files" /> - </path> - </timestampselector> - - <echo message="${latest.fl.tstamp}" /> - </target> - - <target name="filestamp.pr" depends="init"> - <timestampselector property="latest.pr.tstamp" - pathref="test.files.path" /> - - <echo message="${latest.pr.tstamp}" /> - </target> - - <target name="dirstamp.dl" depends="init"> - <timestampselector property="latest.dl.tstamp"> - <path> - <dirset refid="test.dirs" /> - </path> - </timestampselector> - - <echo message="${latest.dl.tstamp}" /> - - </target> - - <target name="dirstamp.pr" depends="init"> - <timestampselector property="latest.pr.tstamp" - pathref="test.dirs.path" /> - - <echo message="${latest.pr.tstamp}" /> - </target> - -</project> diff --git a/test/resources/logic/trycatch.xml b/test/resources/logic/trycatch.xml deleted file mode 100644 index b8f020d..0000000 --- a/test/resources/logic/trycatch.xml +++ /dev/null @@ -1,108 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="fullTest" depends="setup"> - <trycatch property="foo" reference="bar"> - <try> - <fail>Tada!</fail> - </try> - - <catch> - <echo>In <catch>.</echo> - </catch> - - <finally> - <echo>In <finally>.</echo> - </finally> - </trycatch> - </target> - - <target name="twoCatches" depends="setup"> - <trycatch> - <try> - <fail>Tada!</fail> - </try> - - <catch> - <echo>In <catch>.</echo> - </catch> - - <catch> - <echo>In <catch2>.</echo> - </catch> - </trycatch> - </target> - - <target name="twoFinallys" depends="setup"> - <trycatch> - <try> - <fail>Tada!</fail> - </try> - - <finally> - <echo>In <finally>.</echo> - </finally> - - <finally> - <echo>In <finally2>.</echo> - </finally> - </trycatch> - </target> - - <target name="twoTrys" depends="setup"> - <trycatch> - <try> - <fail>Tada!</fail> - </try> - - <try> - <fail>Tada!</fail> - </try> - - <catch> - <echo>In <catch>.</echo> - </catch> - - <finally> - <echo>In <finally>.</echo> - </finally> - </trycatch> - </target> - - <target name="noTry" depends="setup"> - <trycatch> - <catch> - <echo>In <catch>.</echo> - </catch> - - <finally> - <echo>In <finally>.</echo> - </finally> - </trycatch> - </target> - - <target name="noException" depends="setup"> - <trycatch property="foo" reference="bar"> - <try> - <echo>Tada!</echo> - </try> - - <catch> - <echo>In <catch>.</echo> - </catch> - - <finally> - <echo>In <finally>.</echo> - </finally> - </trycatch> - </target> - -</project>
\ No newline at end of file diff --git a/test/resources/math/mathtest.xml b/test/resources/math/mathtest.xml deleted file mode 100644 index df4d731..0000000 --- a/test/resources/math/mathtest.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0"?> - -<project name="mathtest" basedir="." default="test1"> - <description> - test build file for the Math task - </description> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <target name="test1"> - <var name="op1" value="12"/> - <var name="op2" value="6"/> - <var name="op" value="+"/> - - <!-- demo plus --> - <math result="result" operand1="${op1}" - operation="${op}" operand2="${op2}" datatype="int"/> - <echo>${op1} ${op} ${op2} = ${result}</echo> - </target> -</project> diff --git a/test/resources/platform/osfamily.xml b/test/resources/platform/osfamily.xml deleted file mode 100644 index c90b07f..0000000 --- a/test/resources/platform/osfamily.xml +++ /dev/null @@ -1,20 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <target name="consistency"> - <osfamily property="foo"/> - <condition property="consistent"> - <os family="${foo}"/> - </condition> - </target> - - <target name="missingProperty"> - <osfamily/> - </target> -</project> diff --git a/test/resources/platform/shellscript.xml b/test/resources/platform/shellscript.xml deleted file mode 100644 index fc00d91..0000000 --- a/test/resources/platform/shellscript.xml +++ /dev/null @@ -1,108 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <!-- targets used to check if a shell exists --> - <target name="hassh"> <shellscript shell="sh"/> </target> - <target name="hasbash"> <shellscript shell="bash"/> </target> - <target name="hasperl"> <shellscript shell="perl"/> </target> - <target name="haspython"> <shellscript shell="python"/> </target> - <target name="hassed"> - <!-- Temporary hack, since SED is hanging the tests on windows --> - <fail /> - <shellscript shell="sed"/> - </target> - <target name="hascmd"> - <shellscript shell="cmd.exe" tmpsuffix=".bat"> - <arg value="/C" /> - echo a - </shellscript> - </target> - - <target name="sh.hello"> - <shellscript shell="sh"> - echo "hello world" - </shellscript> - </target> - - <target name="bash.hello"> - <shellscript shell="bash"> - echo "hello world" - </shellscript> - </target> - - <!-- python needs to start on the first col --> - <target name="python.hello"> - <shellscript shell="python"> -print "hello world" - </shellscript> - </target> - - <target name="perl.hello"> - <shellscript shell="perl"> - print STDOUT "hello world\n"; - </shellscript> - </target> - - <target name="noshell"> - <shellscript shell="!!!!^^^a shell that should not exist^^^^^!!!!"/> - </target> - - - <target name="sh.inputstring"> - <shellscript shell="sh" inputstring="echo hello world"/> - </target> - - <target name="sed.test"> - <shellscript shell="sed" > - <arg value="-e"/> - <arg value="s/FOO/BAR/g"/> - FOO bar bar bar FOO bar bar - </shellscript> - </target> - - <target name="sh.property"> - <property name="my.sh.property" value="this is a property"/> - <shellscript executable="sh"> - echo ${my.sh.property} - </shellscript> - </target> - - <target name="sh.set.property"> - <shellscript shell="sh" outputproperty="sh.set.property"> - echo hello world - </shellscript> - </target> - - <target name="sh.tmp.suffix"> - <shellscript shell="sh" tmpsuffix=".bat"> - echo $0 - </shellscript> - </target> - - <target name="cmd.test"> - <shellscript shell="cmd.exe" tmpsuffix=".bat"> - <arg value="/C"/> - <arg value="call"/> - echo hello world - </shellscript> - </target> - - <target name="dir.test"> - <mkdir dir="subdir"/> - <shellscript shell="sh" dir="subdir" outputproperty="dir.test.property"> - current=`pwd` - echo "dir is $current" - </shellscript> - <delete dir="subdir"/> - </target> - - <target name="command.test"> - <shellscript command="this should not work"/> - </target> -</project> diff --git a/test/resources/property/pathtofileset.xml b/test/resources/property/pathtofileset.xml deleted file mode 100644 index b330cdf..0000000 --- a/test/resources/property/pathtofileset.xml +++ /dev/null @@ -1,45 +0,0 @@ -<project default="simple"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <target name="cleanup"> - <delete quiet ="yes" dir="${test.dir}"/> - </target> - - <target name="init"> - <property name="test.dir" value="pathtofilesset"/> - <mkdir dir="${test.dir}/0/0"/> - <mkdir dir="${test.dir}/0/1"/> - <mkdir dir="${test.dir}/1/0"/> - <mkdir dir="${test.dir}/1/1"/> - <touch file="${test.dir}/0/0/0.java"/> - <touch file="${test.dir}/0/1/1.java"/> - <touch file="${test.dir}/1/0/2.java"/> - <touch file="${test.dir}/1/1/3.java"/> - </target> - - <target name="simple" depends="init"> - <path id="simple"> - <fileset dir="${test.dir}/0" includes="**/*.java"/> - <fileset dir="${test.dir}/1" includes="**/*.java"/> - </path> - <pathtofileset dir="${test.dir}/0" pathrefid="simple" - ignoreNonRelative="yes" name="simple.0.fileset"/> - <pathconvert targetos="unix" refid="simple.0.fileset" property="simple.0.property"/> - - <pathtofileset dir="${test.dir}/1" pathrefid="simple" - ignoreNonRelative="yes" name="simple.1.fileset"/> - <pathconvert targetos="unix" refid="simple.1.fileset" property="simple.1.property"/> - </target> - - <target name="simple-exception" depends="init"> - <path id="simple"> - <fileset dir="${test.dir}/0" includes="**/*.java"/> - <fileset dir="${test.dir}/1" includes="**/*.java"/> - </path> - <pathtofileset dir="${test.dir}/0" pathrefid="simple" - name="simple.0.fileset"/> - </target> - -</project> diff --git a/test/resources/property/propertycopy.xml b/test/resources/property/propertycopy.xml deleted file mode 100644 index 9425416..0000000 --- a/test/resources/property/propertycopy.xml +++ /dev/null @@ -1,33 +0,0 @@ -<project default="invalid"> - <target name="invalid"> - <fail>Don't call this file directly.</fail> - </target> - - <target name="setup"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - </target> - - <target name="missingName" depends="setup"> - <propertycopy from="foo"/> - </target> - - <target name="missingFrom" depends="setup"> - <propertycopy name="foo"/> - </target> - - <target name="nonSilent" depends="setup"> - <propertycopy name="foo" from="bar"/> - </target> - - <target name="silent" depends="setup"> - <propertycopy name="foo" from="bar" silent="true"/> - </target> - - <target name="normal" depends="setup"> - <property name="org" value="MyOrg" /> - <property name="org.MyOrg.DisplayName" value="My Organiziation" /> - <propertycopy name="displayName" from="org.${org}.DisplayName" /> - </target> -</project>
\ No newline at end of file diff --git a/test/resources/property/propertyselector.properties b/test/resources/property/propertyselector.properties deleted file mode 100644 index 8df9c0e..0000000 --- a/test/resources/property/propertyselector.properties +++ /dev/null @@ -1,7 +0,0 @@ -#Module 1 Properties -module.Module1.id=1 -module.Module1.name=Module 1 - -#Module 2 Properties -module.Module2.id=2 -module.Module2.name=Module 2 diff --git a/test/resources/property/propertyselector.xml b/test/resources/property/propertyselector.xml deleted file mode 100644 index d03eea0..0000000 --- a/test/resources/property/propertyselector.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="Project" default="build" basedir="."> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> - - <property file="propertyselector.properties" /> - - <target name="init"> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - <property file="propertyselector.properties" /> - </target> - - <target name="select.test.grouping.0" depends="init"> - <propertyselector property="module.list" - match="module\.([^\.]*)\.id" - delimiter="," - casesensitive="false" /> - - <echo message="${module.list}" /> - </target> - - <target name="select.test.grouping.1" depends="init"> - <propertyselector property="module.list" - match="module\.([^\.]*)\.id" - select="\1" - delimiter="," - casesensitive="false" /> - - <echo message="${module.list}" /> - </target> - -</project> diff --git a/test/resources/property/variabletest.xml b/test/resources/property/variabletest.xml deleted file mode 100644 index 534743e..0000000 --- a/test/resources/property/variabletest.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0"?> - -<project name="variabletest" basedir="." default="test1"> - <description> - test build file for the Variable task - </description> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <!-- use like a standard property --> - <target name="test1"> - <var name="x" value="6" /> - </target> - - <!-- use like a standard property --> - <target name="test2"> - <var name="x" value="12" /> - </target> - - <!-- can append to itself --> - <target name="test3"> - <var name="x" value="12" /> - <var name="x" value="6 + ${x}" /> <!-- 6 + 12 --> - </target> - - <!-- property can't override --> - <target name="test4"> - <var name="x" value="6" /> - <property name="x" value="12" /> - </target> - - <!-- can append multiple times --> - <target name="test5"> - <var name="str" value="I" /> - <var name="str" value="${str} am" /> - <var name="str" value="${str} a" /> - <var name="str" value="${str} string." /> - <!-- I am a string. --> - </target> - - <!-- property can't override --> - <target name="test6"> - <var name="x" value="blue" /> - <tstamp> - <format property="x" pattern="EEEE" /> - </tstamp> - <var name="x" value="Today is ${x}."/> - <!-- Today is blue. --> - </target> - - <!-- can override property --> - <target name="test7"> - <property name="x" value="12" /> - <var name="x" value="6" /> - </target> - - <!-- TODO: uses the Antelope <if>, need to adjust to use ant-contrib <if> - <target name="test8"> - <var name="x" value="6"/> - <if name="x" value="6"> - <var name="x" value="12"/> - <else> - <var name="x" value="13"/> - </else> - </if> - <echo>${x}</echo> - </target> - --> - - <target name="test9"> - <property name="i" value="2"/> - <var name="i" unset="true"/> - </target> - - <target name="test10"> - <var name="x" value="test"/> - <var name="x" unset="true"/> - <property name="x" value="xxx"/> - </target> -</project> diff --git a/test/resources/walls/compilewithwalls.xml b/test/resources/walls/compilewithwalls.xml deleted file mode 100644 index 6298d76..0000000 --- a/test/resources/walls/compilewithwalls.xml +++ /dev/null @@ -1,237 +0,0 @@ -<project name="test_compilewithwalls" basedir="." default="cleanup"> - <property name="test.dir" value="compilewithwalls"/> - - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath location="${antcontrib.jar}"/> - </taskdef> - - <target name="cleanup"> - <delete quiet="yes" dir="${test.dir}"/> - </target> - - <target name="init"> - </target> - - <target name="testTooManyNestedWallElements" depends="init"> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls /> - <walls /> - <javac /> - </compilewithwalls> - </target> - - <target name="testTooManyNestedJavacElements" depends="init"> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls /> - <javac /> - <javac /> - </compilewithwalls> - </target> - - <target name="testNoWallElement" depends="init"> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <javac /> - </compilewithwalls> - </target> - - <target name="testNoJavacElement" depends="init"> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls /> - </compilewithwalls> - </target> - - <target name="testNoSrcDirInJavac" depends="init"> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls> - <package name="modA" package="biz.xsoftware" /> - </walls> - - <javac> - </javac> - </compilewithwalls> - </target> - - <target name="testIntermediaryDirAndDestDirSame" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir1"> - <walls> - </walls> - - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - </target> - - <target name="testIntermediaryDirInsideDestDir" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - <compilewithwalls intermediaryBuildDir="${test.dir}/dir1/insideDestDir"> - <walls> - </walls> - - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - </target> - - <target name="testPackageDoesntEndWithStar" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls> - <package name="modA" package="biz.xsoftware" /> - </walls> - - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - - </target> - - <target name="testPackageDoesntHaveSlash" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls> - <package name="modA" package="biz/xsoftware.*" /> - </walls> - - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - </target> - - <target name="testDependsOnNonExistPackage" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls> - <package name="modA" - package="biz.xsoftware.*" - depends="modB" /> - </walls> - - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - - </target> - - <target name="testDependsOnPackageAfter" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - - <compilewithwalls intermediaryBuildDir="${test.dir}/dir2"> - <walls> - <package name="modA" - package="biz.xsoftware.*" - depends="modB" /> - <package name="modB" - package="biz.xsoftware.something.*" /> - </walls> - - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - - </target> - - <target name="testPackageABreakingWhenAIsCompiledFirst" depends="init"> - <mkdir dir="${test.dir}/classes/testA" /> - <compilewithwalls intermediaryBuildDir="${test.dir}/classes/testAtemp"> - <walls> - <package name="modA" - package="mod.modA.*" /> - <package name="modB" - package="mod.modB.*" /> - <package name="mod" - package="mod.*" - depends="modA,modB" /> - </walls> - - <javac srcdir="./testA" destdir="${test.dir}/classes/testA"> - </javac> - </compilewithwalls> - - </target> - - <target name="testPackageBBreakingWhenAIsCompiledFirst" depends="init"> - <mkdir dir="${test.dir}/classes/testB" /> - <compilewithwalls intermediaryBuildDir="${test.dir}/classes/testBtemp"> - <walls> - <package name="modA" - package="mod.modA.*" /> - <package name="modB" - package="mod.modB.*" /> - <package name="mod" - package="mod.*" - depends="modA,modB" /> - </walls> - - <javac srcdir="./testB" destdir="${test.dir}/classes/testB"> - </javac> - </compilewithwalls> - - </target> - - <target name="testMoreThanOneSrcDirInJavac" depends="init"> - <mkdir dir="${test.dir}/classes/testX" /> - <compilewithwalls intermediaryBuildDir="${test.dir}/classes/testXtemp"> - <walls/> - <javac destdir="${test.dir}/classes/testX"> - <src path="${test.dir}/dir1"> - </src> - <src path="xyz"> - </src> - </javac> - </compilewithwalls> - </target> - - <target name="testCompileOfAllUsingDepends" depends="init"> - <mkdir dir="${test.dir}/classes/testC" /> - <compilewithwalls intermediaryBuildDir="${test.dir}/classes/testCtemp"> - <walls> - <package name="modA" - package="mod.modA.*" /> - <package name="modB" - package="mod.modB.*" /> - <package name="mod" - package="mod.*" - depends="modA,modB" /> - </walls> - - <javac srcdir="./testC" destdir="${test.dir}/classes/testC"> - </javac> - </compilewithwalls> - - </target> - -<!-- -********************************************************* - These are mostly the same tests above but making sure it works with - external walls.xml file. -********************************************************* ---> - <target name="testDependsOnPackageAfterExternalWalls" depends="init"> - <mkdir dir="${test.dir}/dir1" /> - <compilewithwalls walls="dependsafter.xml" intermediaryBuildDir="${test.dir}/dir2"> - <javac srcdir="${test.dir}/dir1" destdir="${test.dir}/dir1"> - </javac> - </compilewithwalls> - </target> - - <target name="testPackageBBreakingWhenAIsCompiledFirstExternalWalls" depends="init"> - <mkdir dir="${test.dir}/classes/testB" /> - <compilewithwalls walls="packageB-break.xml" intermediaryBuildDir="${test.dir}/classes/testBtemp"> - <javac srcdir="./testB" destdir="${test.dir}/classes/testB"> - </javac> - </compilewithwalls> - </target> - - <target name="testCompileOfAllUsingDependsExternalWalls" depends="init"> - <mkdir dir="${test.dir}/classes/testC" /> - <compilewithwalls walls="walls.xml" intermediaryBuildDir="${test.dir}/classes/testCtemp"> - <javac srcdir="./testC" destdir="${test.dir}/classes/testC"> - </javac> - </compilewithwalls> - </target> - -</project> diff --git a/test/resources/walls/dependsafter.xml b/test/resources/walls/dependsafter.xml deleted file mode 100644 index 30aac80..0000000 --- a/test/resources/walls/dependsafter.xml +++ /dev/null @@ -1,7 +0,0 @@ - <walls> - <package name="modA" - package="biz.xsoftware.*" - depends="modB" /> - <package name="modB" - package="biz.xsoftware.something.*" /> - </walls>
\ No newline at end of file diff --git a/test/resources/walls/packageB-break.xml b/test/resources/walls/packageB-break.xml deleted file mode 100644 index 4fa8bb3..0000000 --- a/test/resources/walls/packageB-break.xml +++ /dev/null @@ -1,9 +0,0 @@ -<walls> - <package name="modA" - package="mod.modA.*" /> - <package name="modB" - package="mod.modB.*" /> - <package name="mod" - package="mod.*" - depends="modA,modB" /> -</walls>
\ No newline at end of file diff --git a/test/resources/walls/testA/mod/modA/ModuleA.java b/test/resources/walls/testA/mod/modA/ModuleA.java deleted file mode 100644 index 6950bdc..0000000 --- a/test/resources/walls/testA/mod/modA/ModuleA.java +++ /dev/null @@ -1,10 +0,0 @@ - -package mod.modA; - -import mod.modB.ModuleB; - -public class ModuleA -{ - private ModuleB moduleB; - -};
\ No newline at end of file diff --git a/test/resources/walls/testA/mod/modB/ModuleB.java b/test/resources/walls/testA/mod/modB/ModuleB.java deleted file mode 100644 index 10175b5..0000000 --- a/test/resources/walls/testA/mod/modB/ModuleB.java +++ /dev/null @@ -1,6 +0,0 @@ - -package mod.modB; - -public class ModuleB -{ -};
\ No newline at end of file diff --git a/test/resources/walls/testB/mod/modA/TestBModuleA.java b/test/resources/walls/testB/mod/modA/TestBModuleA.java deleted file mode 100644 index b6b7929..0000000 --- a/test/resources/walls/testB/mod/modA/TestBModuleA.java +++ /dev/null @@ -1,7 +0,0 @@ - -package mod.modA; - -public class TestBModuleA -{ - -};
\ No newline at end of file diff --git a/test/resources/walls/testB/mod/modB/TestBModuleB.java b/test/resources/walls/testB/mod/modB/TestBModuleB.java deleted file mode 100644 index c7428ff..0000000 --- a/test/resources/walls/testB/mod/modB/TestBModuleB.java +++ /dev/null @@ -1,9 +0,0 @@ - -package mod.modB; - -import mod.modA.TestBModuleA; - -public class TestBModuleB -{ - private TestBModuleA temp; -};
\ No newline at end of file diff --git a/test/resources/walls/testC/mod/TestCModule.java b/test/resources/walls/testC/mod/TestCModule.java deleted file mode 100644 index 5d9c0e8..0000000 --- a/test/resources/walls/testC/mod/TestCModule.java +++ /dev/null @@ -1,11 +0,0 @@ - -package mod; - -import mod.modA.TestCModuleA; -import mod.modB.TestCModuleB; - -public class TestCModule -{ - private TestCModuleA temp1; - private TestCModuleB temp2; -};
\ No newline at end of file diff --git a/test/resources/walls/testC/mod/modA/TestCModuleA.java b/test/resources/walls/testC/mod/modA/TestCModuleA.java deleted file mode 100644 index 8b9f8d6..0000000 --- a/test/resources/walls/testC/mod/modA/TestCModuleA.java +++ /dev/null @@ -1,7 +0,0 @@ - -package mod.modA; - -public class TestCModuleA -{ - -};
\ No newline at end of file diff --git a/test/resources/walls/testC/mod/modB/TestCModuleB.java b/test/resources/walls/testC/mod/modB/TestCModuleB.java deleted file mode 100644 index 989ebdf..0000000 --- a/test/resources/walls/testC/mod/modB/TestCModuleB.java +++ /dev/null @@ -1,7 +0,0 @@ - -package mod.modB; - - -public class TestCModuleB -{ -};
\ No newline at end of file diff --git a/test/resources/walls/walls.xml b/test/resources/walls/walls.xml deleted file mode 100644 index d5ca6b8..0000000 --- a/test/resources/walls/walls.xml +++ /dev/null @@ -1,9 +0,0 @@ -<walls> - <package name="modA" - package="mod.modA.*" /> - <package name="modB" - package="mod.modB.*" /> - <package name="mod" - package="mod.*" - depends="modA,modB" /> -</walls>
\ No newline at end of file diff --git a/test/src/net/sf/antcontrib/BuildFileTestBase.java b/test/src/net/sf/antcontrib/BuildFileTestBase.java deleted file mode 100644 index 9764d23..0000000 --- a/test/src/net/sf/antcontrib/BuildFileTestBase.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib; - -import java.io.File; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.net.URL; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.BuildFileTest; - - -/** - * More methods for BuildFileTest. - * - * @author Dale Anson - */ -public abstract class BuildFileTestBase extends BuildFileTest { - - /** - * Constructor for the BuildFileTestBase object - * - * @param name string to pass up to TestCase constructor - */ - public BuildFileTestBase( String name ) { - super( name ); - } - - /** - * run a target, expect a build exception - * - * @param target target to run - */ - protected void expectBuildException( String target ) { - expectSpecificBuildException( target, "no specific reason", null ); - } - - /** - * Assert that the given message has NOT been logged with a priority >= INFO - * when running the given target. - * - * @param target Description of the Parameter - * @param log Description of the Parameter - */ - protected void expectLogNotContaining( String target, String log ) { - executeTarget( target ); - String realLog = getLog(); - assertTrue( "expecting log to NOT contain \"" + log + "\" log was \"" - + realLog + "\"", - realLog.indexOf( log ) < 0 ); - } - - /** - * set up to run the named project - * <p> - * Overrides BuildFileTest.configureProject to first - * attempt to make a File out of the filename parameter, if the resulting - * file does not exists, then attempt to locate the file in the classpath. - * This way, test xml files can be placed alongside of their corresponding - * class file and can be easily found. - * - * @param filename name of project file to run - * @exception BuildException Description of the Exception - */ - protected void configureProject( String filename ) throws BuildException { - // find the build file - File f = new File( filename ); - if ( !f.exists() ) { - URL url = getClass().getClassLoader().getResource( filename ); - if ( url == null ) - throw new BuildException( "Can't find " + filename ); - f = new File( url.getPath() ); - if ( !f.exists() ) - throw new BuildException( "Can't find " + filename ); - } - super.configureProject(f.getAbsolutePath()); - } - - /** - * run a target, expect an exception string containing the substring we look - * for (case sensitive match) - * - * @param target target to run - * @param cause information string to reader of report - * @param contains substring of the build exception to look for - */ - protected void expectBuildExceptionStackTraceContaining( String target, String cause, String contains ) { - try { - executeTarget( target ); - } - catch ( org.apache.tools.ant.BuildException ex ) { - //buildException = ex; // buildException has private access in super - StringWriter stacktrace = new StringWriter(); - PrintWriter writer = new PrintWriter( stacktrace, true ); - ex.printStackTrace( writer ); - String trace = stacktrace.toString(); - if ( ( null != contains ) && ( trace.indexOf( contains ) == -1 ) ) { - fail( "Should throw BuildException because '" + cause + "' with message containing '" + contains + "' (actual message '" + trace + "' instead)" ); - } - return; - } - fail( "Should throw BuildException because: " + cause ); - } -} - diff --git a/test/src/net/sf/antcontrib/antclipse/AntclipseTest.java b/test/src/net/sf/antcontrib/antclipse/AntclipseTest.java deleted file mode 100644 index 973a8b9..0000000 --- a/test/src/net/sf/antcontrib/antclipse/AntclipseTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.antclipse; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Basic test for "antclipse" task. For the moment it just launches the test xml script. - * @author Adrian Spinei [email protected] - * @version $Revision: 1.2 $ - */ -public class AntclipseTest extends BuildFileTest -{ - - /** - * Simple overriden constructor - * @param arg0 - */ - public AntclipseTest(String arg0) - { - super(arg0); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - public void setUp() - { - configureProject("test/resources/antclipse/antclipsetest.xml"); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - public void tearDown() - { - //nothing to do - } - - /** - * Launches the "everything" task. Should not throw errors. - */ - public void testExecuteDefaultBuild() - { - executeTarget("everything"); - } - -} diff --git a/test/src/net/sf/antcontrib/antserver/AntServerTest.java b/test/src/net/sf/antcontrib/antserver/AntServerTest.java deleted file mode 100644 index 24cdca9..0000000 --- a/test/src/net/sf/antcontrib/antserver/AntServerTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.antserver; - -import net.sf.antcontrib.BuildFileTestBase; - - -/**************************************************************************** - * Place class description here. - * - * @author inger - * @author <additional author> - * - * @since - * - ****************************************************************************/ - - -public class AntServerTest - extends BuildFileTestBase -{ - public AntServerTest(String name) - { - super(name); - } - - - public void setUp() - { - configureProject("test/resources/antserver/antservertest.xml"); - } - - public void tearDown() - { - executeTarget("cleanup"); - } - - public void test1() - { - String expected[] = new String[] - { - "Test1 Successfully Called", - "[test1_remote]" - }; - - expectLogContaining("test1", expected); - } - - public void test2() - { - String expected[] = new String[] - { - "Test2 Successfully Called", - "[test2_remote]" - }; - - expectLogContaining("test2", expected); - } - - public void test3() - { - String expected[] = new String[] - { - "Test3 Successfully Called", - "[test3_remote]" - }; - - expectLogContaining("test3", expected); - } - - public void test4() - { - String expected[] = new String[] - { - "Test4 Successfully Called", - "[test4_remote]" - }; - - expectLogContaining("test4", expected); - } - - public void test5() - { - this.executeTarget("test5"); - } - - /** - * Assert that the given message has been logged with a priority - * >= INFO when running the given target. - */ - protected void expectLogContaining(String target, - String logs[]) - { - executeTarget(target); - String realLog = getLog(); - - int cnt = 0; - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < logs.length; i++) - { - if (realLog.indexOf(logs[i]) >= 0) - cnt++; - if (i != 0) - sb.append(" and "); - sb.append("\"").append(logs[i]).append("\""); - } - - - assertTrue("expecting log to contain " + sb.toString() - + " log was \"" + realLog + "\"", - cnt == logs.length); - } - -} diff --git a/test/src/net/sf/antcontrib/design/VerifyDesignTest.java b/test/src/net/sf/antcontrib/design/VerifyDesignTest.java deleted file mode 100644 index 746448c..0000000 --- a/test/src/net/sf/antcontrib/design/VerifyDesignTest.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (c) 2001-2005 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.design; - -import java.io.File; - -import junit.framework.TestSuite; -import junit.textui.TestRunner; - -import org.apache.tools.ant.BuildFileTest; -import org.apache.tools.ant.util.JavaEnvUtils; - -/** - * BIG NOTE*************************************************** - * Always expect specific exceptions. Most of these test cases when - * first submitted were not and therefore were not testing what they said - * they were testing. Exceptions were being caused by other things and the - * tests were still passing. Now all tests expect a specific exception - * so if any other is thrown we will fail the test case. - * ************************************************************ - * - * Testcase for <propertycopy>. - */ -public class VerifyDesignTest extends BuildFileTest { - - private final static String REASON = "Build should have failed with proper message and did not"; - private String baseDir = "test"+File.separator - +"resources"+File.separator - +"design"+File.separator; - private String c = File.separator; - - public VerifyDesignTest(String name) { - super(name); - } - - public void setUp() { - - configureProject("test/resources/design/verifydesign.xml"); -// project.log("ASFDSADF", Project.MSG_INFO); - } - - private static String s = ""; - - public static void log(String msg) { - s += msg+"\n"; - } - - public void tearDown() { - executeTarget("cleanup"); - - //System.out.println("test log=\n"+s); - } - - public void testArrayDepend() { - String class1 = "mod.arraydepend.ClassDependsOnArray"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testArrayDepend", Design.getErrorMessage(class1, class2)); - } - - public void testArrayDepend2() { - executeTarget("testArrayDepend2"); - } - - public void testArrayDepend3() { - String class1 = "mod.arraydepend3.ClassDependsOnArray"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testArrayDepend3", Design.getErrorMessage(class1, class2)); - } - - public void testBadXML() { - File designFile = new File("test/resources/design/designfiles/badxml.xml"); - String msg = "\nProblem parsing design file='" - + designFile.getAbsolutePath() + "'. \nline=3 column=1 Reason:\nElement type \"design\" must be followed by either attribute specifications, \">\" or \"/>\".\n"; - expectSpecificBuildException("testBadXML", REASON, msg); - } - - public void testCastDepend() { - String class1 = "mod.castdepend.ClassDependsOnCast"; - String class2 = "mod.dummy.DummyInterface"; - expectDesignCheckFailure("testCastDepend", Design.getErrorMessage(class1, class2)); - } - - public void testCatchDepend() { - String class1 = "mod.catchdepend.ClassDependsOnCatch"; - String class2 = "mod.dummy.DummyRuntimeException"; - expectDesignCheckFailure("testCatchDepend", Design.getErrorMessage(class1, class2)); - } - - public void testClassFiles() { - String class1 = "mod.castdepend.ClassDependsOnCast"; - String class2 = "mod.dummy.DummyInterface"; - expectDesignCheckFailure("testClassFiles", Design.getErrorMessage(class1, class2)); - } - - public void testDeclareJavaUtil() { - executeTarget("testDeclareJavaUtil"); - } - - public void testDeclareJavaUtilFail() { - String class1 = "mod.declarejavautil.ClassDependsOnJavaUtil"; - String class2 = "java.util.List"; - expectDesignCheckFailure("testDeclareJavaUtilFail", Design.getErrorMessage(class1, class2)); - } - - public void testDeclareJavax() { - String class1 = "mod.declarejavax.ClassDependsOnJavax"; - String class2 = "javax.swing.JButton"; - expectDesignCheckFailure("testDeclareJavax", Design.getErrorMessage(class1, class2)); - } - - public void testDeclareJavaxPass() { - executeTarget("testDeclareJavaxPass"); - } - - - //tests to write - - //depend on java.util should pass by default - //depend on java.util should fail after defining needDeclareTrue - //depend on javax.swing should pass after needDeclareFalse - - //depend on dummy should pass after needDeclareFalse - - public void testFieldDepend() { - String class1 = "mod.fielddepend.ClassDependsOnField"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testFieldDepend", Design.getErrorMessage(class1, class2)); - } - - public void testFieldRefDepend() { - if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) - || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) - || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) { - return; - } - - String class1 = "mod.fieldrefdepend.ClassDependsOnReferenceInFieldDeclaration"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testFieldRefDepend", Design.getErrorMessage(class1, class2)); - } - - public void testInnerClassDepend() { - String class1 = "mod.innerclassdepend.InnerClassDependsOnSuper$Inner"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testInnerClassDepend", Design.getErrorMessage(class1, class2)); - } - - public void testInstanceOfDepend() { - String class1 = "mod.instanceofdepend.ClassDependsOnInstanceOf"; - String class2 = "mod.dummy.DummyInterface"; - expectDesignCheckFailure("testInstanceOfDepend", Design.getErrorMessage(class1, class2)); - } - - public void testInterfaceDepend() { - String class1 = "mod.interfacedepend.ClassDependsOnInterfaceMod2"; - String class2 = "mod.dummy.DummyInterface"; - expectDesignCheckFailure("testInterfaceDepend", Design.getErrorMessage(class1, class2)); - } - - public void testLocalVarDepend() { - String class1 = "mod.localvardepend.ClassDependsOnLocalVar"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testLocalVarDepend", Design.getErrorMessage(class1, class2)); - } - - public void testLocalVarRefDepend() { - if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) - || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) - || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) { - return; - } - String class1 = "mod.localvarrefdepend.ClassDependsOnLocalVariableReference"; - String class2 = "mod.dummy.DummyInterface"; - expectDesignCheckFailure("testLocalVarRefDepend", Design.getErrorMessage(class1, class2)); - } - - public void testMissingAttribute() { - File designFile = new File("test/resources/design/designfiles/missingattribute.xml"); - String msg = "\nProblem parsing design file='" - + designFile.getAbsolutePath() + "'. \nline=3 column=31 Reason:\nError in file=" - + designFile.getAbsolutePath() + ", package element must contain the 'name' attribute\n"; - expectSpecificBuildException("testMissingAttribute", REASON, msg); - } - - public void testMultipleErrors() { - File jarFile = new File(baseDir+File.separator+"build"+File.separator+"jar" - +File.separator+"test.jar"); - String class1 = "mod.arraydepend.ClassDependsOnArray"; - String class2 = "mod.dummy.DummyClass"; - //executeTarget("testMultipleErrors"); - String error1 = Design.getWrapperMsg(jarFile, Design.getErrorMessage(class1, class2)); - class1 = "mod.castdepend.ClassDependsOnCast"; - String error2 = Design.getWrapperMsg(jarFile, Design.getNoDefinitionError(class1)); - class1 = "mod.catchdepend.ClassDependsOnCatch"; - class2 = "mod.dummy.DummyRuntimeException"; - String error3 = Design.getWrapperMsg(jarFile, Design.getErrorMessage(class1, class2)); - String s = "\nEvaluating package=mod.arraydepend"+error1; - s += "\nEvaluating package=mod.castdepend"+error2; - s += "\nEvaluating package=mod.catchdepend"+error3; - s += "\nEvaluating package=mod.dummy"; - -// executeTarget("testMultipleErrors"); - expectDesignCheckFailure("testMultipleErrors", s); - } - - public void testNewDepend() { - String class1 = "mod.newdepend.ClassDependsOnNew"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testNewDepend", Design.getErrorMessage(class1, class2)); - } - - public void testNewDepend2() { - String class1 = "mod.newdepend2.ClassDependsOnNewInField"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testNewDepend2", Design.getErrorMessage(class1, class2)); - } - - public void testNoDebugOption() { - String class1 = "mod.nodebugoption.ClassDependsOnLocalVar"; - expectDesignCheckFailure("testNoDebugOption", VisitorImpl.getNoDebugMsg(class1)); - } - public void testNoJar() { - File jar = new File("test/resources/design/build/jar/test.jar"); - expectSpecificBuildException("testNoJar", REASON, VisitorImpl.getNoFileMsg(jar)); - } - - public void testParamDepend() { - String class1 = "mod.paramdepend.ClassDependsOnParameter"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testParamDepend", Design.getErrorMessage(class1, class2)); - } - - public void testPassLocalDepend() { - executeTarget("testPassLocalDepend"); - } - - public void testPathElementLocation() { - executeTarget("testPathElementLocation"); - } - - public void testPathElementPath() { - executeTarget("testPathElementPath"); - } - - public void testPutStatic() { - executeTarget("testPutStatic"); - } - - public void testRecursion() { - executeTarget("testRecursion"); - } - - public void testRecursion2() { - executeTarget("testRecursion2"); - } - - public void testRecursion3() { - executeTarget("testRecursion3"); - } - - public void testReturnValDepend() { - String class1 = "mod.returnvaldepend.ClassDependsOnReturnValue"; - String class2 = "mod.dummy.DummyInterface"; - expectDesignCheckFailure("testReturnValDepend", Design.getErrorMessage(class1, class2)); - } - - public void testSignatureExceptionDepend() { - String class1 = "mod.signatureexceptiondepend.ClassDependsOnExceptionInMethodSignature"; - String class2 = "mod.dummy.DummyException"; - expectDesignCheckFailure("testSignatureExceptionDepend", Design.getErrorMessage(class1, class2)); - } - - public void testStaticDepend() { - String class1 = "mod.staticdepend.ClassDependsOnStatic"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testStaticDepend", Design.getErrorMessage(class1, class2)); - } - - public void testStaticField2Depend() { - String class1 = "mod.staticfield2depend.ClassDependsOnStaticField"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testStaticField2Depend", Design.getErrorMessage(class1, class2)); - } - - public void testStaticFieldDepend() { - String class1 = "mod.staticfielddepend.ClassDependsOnStaticField"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testStaticFieldDepend", Design.getErrorMessage(class1, class2)); - } - - public void testStaticFinalDepend() { - //This is an impossible test since javac compiles String and primitive constants into the code - //losing any reference to the class that contains the constant...In this one instance, - //verifydesign can't verify that constant imports don't violate the design!!!! - //check out mod.staticfinaldepend.ClassDependsOnStaticField to see the code - //that will pass the design even if it is violating it. - // String class1 = "mod.staticfinaldepend.ClassDependsOnConstant"; - // String class2 = "mod.dummy.DummyClass"; - // expectDesignCheckFailure("testStaticFinalDepend", Design.getErrorMessage(class1, class2)); - } - - public void testSuperDepend() { - String s = File.separator; - File f = new File("test"+s+"resources"+s+"design"+s+"build"+s+"jar"+s+"test.jar"); - - // executeTarget("testSuperDepend"); - String class1 = "mod.superdepend.ClassDependsOnSuperMod2"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testSuperDepend", Design.getErrorMessage(class1, class2)); - - //jar file should have been deleted - assertTrue("jar file should not exist yet still does", !f.exists()); - } - - public void testWarSuccess() { - executeTarget("testWarSuccess"); - } - - public void testWarFailure() { - String class1 = "mod.warfailure.ClassDependsOnSuperMod2"; - String class2 = "mod.dummy.DummyClass"; - expectDesignCheckFailure("testWarFailure", Design.getErrorMessage(class1, class2)); - } - - public static void main(String[] args) { - TestSuite suite = new TestSuite(); - suite.addTest(new VerifyDesignTest("testArrayDepend2")); - TestRunner.run(suite); - } - - private void expectDesignCheckFailure(String target, String message) { - expectSpecificBuildException(target, "Design is broken", - "Design check failed due to previous " - + "errors"); - assertLogContaining(message); - } -} diff --git a/test/src/net/sf/antcontrib/logic/AntCallBackTest.java b/test/src/net/sf/antcontrib/logic/AntCallBackTest.java deleted file mode 100644 index 3635002..0000000 --- a/test/src/net/sf/antcontrib/logic/AntCallBackTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import net.sf.antcontrib.BuildFileTestBase; - -/** - * Since AntCallBack is basically a copy and paste of antcall, the only testing - * done here is on the extra features provided by antcallback. It is assumed - * that changes to antcall will be propagated to antcallback and that antcall - * has it's own unit tests (which turns out to have been a bad assumption, - * I can't find any unit tests for antcall). - * - * @author danson - */ -public class AntCallBackTest extends BuildFileTestBase { - - /** - * Constructor for the AntCallBackTest object - * - * @param name Description of the Parameter - */ - public AntCallBackTest( String name ) { - super( name ); - } - - - /** The JUnit setup method */ - public void setUp() { - configureProject( "test/resources/logic/antcallbacktest.xml" ); - } - - - /** A unit test for JUnit */ - public void test1() { - expectPropertySet( "test1", "prop1", "prop1" ); - } - - - /** A unit test for JUnit */ - public void test2() { - expectPropertySet( "test2", "prop1", "prop1" ); - expectPropertySet( "test2", "prop2", "prop2" ); - expectPropertySet( "test2", "prop3", "prop3" ); - } - - - /** A unit test for JUnit */ - public void test3() { - expectPropertySet( "test3", "prop1", "prop1" ); - expectPropertySet( "test3", "prop2", "prop2" ); - expectPropertySet( "test3", "prop3", "prop3" ); - } - - - /** A unit test for JUnit */ - public void test4() { - expectPropertyUnset( "test4", "prop1" ); - expectPropertySet( "test4", "prop2", "prop2" ); - expectPropertySet( "test4", "prop3", "prop3" ); - } - - - /** A unit test for JUnit */ - public void test5() { - expectPropertySet( "test5", "prop1", "blah" ); - expectPropertySet( "test5", "prop2", "prop2" ); - expectPropertySet( "test5", "prop3", "prop3" ); - } -} - diff --git a/test/src/net/sf/antcontrib/logic/AssertTest.java b/test/src/net/sf/antcontrib/logic/AssertTest.java deleted file mode 100644 index 449068f..0000000 --- a/test/src/net/sf/antcontrib/logic/AssertTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import net.sf.antcontrib.BuildFileTestBase; - -/** - * Since AntCallBack is basically a copy and paste of antcall, the only testing - * done here is on the extra features provided by antcallback. It is assumed - * that changes to antcall will be propagated to antcallback and that antcall - * has it's own unit tests (which turns out to have been a bad assumption, - * I can't find any unit tests for antcall). - * - * @author danson - */ -public class AssertTest extends BuildFileTestBase { - - /** - * Constructor for the AntCallBackTest object - * - * @param name Description of the Parameter - */ - public AssertTest( String name ) { - super( name ); - } - - - /** The JUnit setup method */ - public void setUp() { - configureProject( "test/resources/logic/asserttest.xml" ); - } - - - /** A unit test for JUnit */ - public void test1() { - executeTarget( "test1" ); - } - - public void test2() { - expectBuildExceptionStackTraceContaining( "test2", "testing assert failure", "Property 'testprop' doesn't exist in this project." ); - } - - public void test3() { - expectBuildExceptionStackTraceContaining( "test3", "testing assert failure", "Expected 'false', but was 'true'." ); - } - - public void test4() { - executeTarget("test4"); - } - - public void test5() { - executeTarget("test5"); - } - - public void test6() { - executeTarget("test6"); - } - - public void test7(){ - expectBuildExceptionStackTraceContaining( "test7", "testing conditions", "Assertion failed boolean test." ); - } - - public void test8() { - executeTarget("test8"); - } - - public void test9() { - expectBuildExceptionStackTraceContaining( "test9", "testing conditions", "Assertion failed boolean test." ); - } -} - diff --git a/test/src/net/sf/antcontrib/logic/ForTest.java b/test/src/net/sf/antcontrib/logic/ForTest.java deleted file mode 100644 index 5313140..0000000 --- a/test/src/net/sf/antcontrib/logic/ForTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2006 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <for>. - */ -public class ForTest extends BuildFileTest { - - public ForTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/for.xml"); - } - - public void testLoop() { - executeTarget("loop"); - assertTrue(getLog().indexOf( - "i is 10") != -1); - } - - public void testStep() { - executeTarget("step"); - assertTrue(getLog().indexOf( - "i is 10") != -1); - assertTrue(getLog().indexOf( - "i is 3") == -1); - } -} diff --git a/test/src/net/sf/antcontrib/logic/ForeachTaskTest.java b/test/src/net/sf/antcontrib/logic/ForeachTaskTest.java deleted file mode 100644 index b02e453..0000000 --- a/test/src/net/sf/antcontrib/logic/ForeachTaskTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <foreach>. - */ -public class ForeachTaskTest extends BuildFileTest { - - public ForeachTaskTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/foreach.xml"); - } - - public void tearDown() { - executeTarget("teardown"); - } - - public void testSimpleList() { - simpleTest("simpleList"); - } - - public void testDelimiter() { - simpleTest("delimiter"); - } - - public void testFileset() { - simpleTest("fileset"); - assertTrue(getLog().indexOf("The nested fileset element is deprectated," - + " use a nested path instead") > -1); - } - - public void testFilesetAndList() { - simpleTest("filesetAndList"); - assertTrue(getLog().indexOf("The nested fileset element is deprectated," - + " use a nested path instead") > -1); - } - - public void testNoList() { - expectSpecificBuildException("noList", "neither list nor fileset", - "You must have a list or path to iterate through"); - } - - public void testNoTarget() { - expectSpecificBuildException("noTarget", "no target", - "You must supply a target to perform"); - } - - public void testNoParam() { - expectSpecificBuildException("noParam", "no param", - "You must supply a property name to set on each iteration in param"); - } - - public void testNestedParam() { - executeTarget("nestedParam"); - assertTrue(getLog().indexOf("Called with param: rincewind") > -1); - } - - public void testNestedReference() { - executeTarget("nestedReference"); - assertTrue(getLog().indexOf("Called with param: twoflower") > -1); - } - - public void testPath() { - simpleTest("path"); - } - - public void testPathAndList() { - simpleTest("pathAndList"); - } - - private void simpleTest(String target) { - executeTarget(target); - int last = -1; - for (int i = 1; i < 4; i++) { - int thisIdx = getLog().indexOf("Called with param: " + i); - assertTrue(thisIdx > last); - last = thisIdx; - } - } -} diff --git a/test/src/net/sf/antcontrib/logic/IfTaskTest.java b/test/src/net/sf/antcontrib/logic/IfTaskTest.java deleted file mode 100644 index bac8aff..0000000 --- a/test/src/net/sf/antcontrib/logic/IfTaskTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <if>. - */ -public class IfTaskTest extends BuildFileTest { - - public IfTaskTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/if.xml"); - } - - public void testNoCondition() { - expectSpecificBuildException("noCondition", "no condition", - "You must nest a condition into <if>"); - } - - public void testTwoConditions() { - expectSpecificBuildException("twoConditions", "two conditions", - "You must not nest more than one " - + "condition into <if>"); - } - - public void testNothingToDo() { - expectLog("nothingToDo", ""); - } - - public void testTwoThens() { - expectSpecificBuildException("twoThens", "two <then>s", - "You must not nest more than one " - + "<then> into <if>"); - } - - public void testTwoElses() { - expectSpecificBuildException("twoElses", "two <else>s", - "You must not nest more than one " - + "<else> into <if>"); - } - - public void testNormalOperation() { - executeTarget("normalOperation"); - assertTrue(getLog().indexOf("In then") > -1); - assertTrue(getLog().indexOf("some value") > -1); - assertEquals(-1, getLog().indexOf("${inner}")); - assertEquals(-1, getLog().indexOf("In else")); - } - - public void testNormalOperation2() { - executeTarget("normalOperation2"); - assertTrue(getLog().indexOf("In else") > -1); - assertEquals(-1, getLog().indexOf("In then")); - } - - public void testNoConditionInElseif() { - expectSpecificBuildException("noConditionInElseif", "no condition", - "You must nest a condition into <elseif>"); - } - - public void testTwoConditionInElseif() { - expectSpecificBuildException("twoConditionsInElseif", "two conditions", - "You must not nest more than one " - + "condition into <elseif>"); - } - - public void testNormalOperationElseif() { - executeTarget("normalOperationElseif"); - assertTrue(getLog().indexOf("In elseif") > -1); - assertEquals(-1, getLog().indexOf("In then")); - assertEquals(-1, getLog().indexOf("In else-branch")); - } - - public void testNormalOperationElseif2() { - executeTarget("normalOperationElseif2"); - assertTrue(getLog().indexOf("In else-branch") > -1); - assertEquals(-1, getLog().indexOf("In then")); - assertEquals(-1, getLog().indexOf("In elseif")); - } - -} diff --git a/test/src/net/sf/antcontrib/logic/OutOfDateTest.java b/test/src/net/sf/antcontrib/logic/OutOfDateTest.java deleted file mode 100644 index ae52caa..0000000 --- a/test/src/net/sf/antcontrib/logic/OutOfDateTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; -import org.apache.tools.ant.types.Path; - -/** - * Testcase for <outofdate>. - * - * @author Peter Reilly - */ -public class OutOfDateTest extends BuildFileTest { - - public OutOfDateTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/outofdate.xml"); - } - - public void tearDown() { - executeTarget("cleanup"); - } - - public void testSimple() { - executeTarget("simple"); - } - - public void testVerbose() { - executeTarget("verbose"); - assertTrue(getLog().indexOf("outofdate with regard to") > -1); - } - - public void testDelete() { - executeTarget("delete"); - } - - public void testDeleteAll() { - executeTarget("delete-all"); - } - - public void testDeleteQuiet() { - executeTarget("init"); - executeTarget("delete-quiet"); - assertTrue("No deleting message", getLog().indexOf("Deleting") == -1); - } - - public void testFileset() { - executeTarget("outofdate.init"); - executeTarget("outofdate.test"); - assertTrue(getLog().indexOf("outofdate triggered") > -1); - String outofdateSources = - getProject().getProperty("outofdate.sources"); - // switch \ to / if present - outofdateSources.replace('\\', '/'); - assertTrue("newer.text empty", outofdateSources.indexOf( - "newer.text") > -1); - assertTrue("file.notdone", outofdateSources.indexOf( - "outofdate/source/1/2/file.notdone") > -1); - assertTrue("file.done", outofdateSources.indexOf( - "outofdate/source/1/2/file.done") == -1); - assertTrue("done.y", outofdateSources.indexOf( - "outofdate/source/1/done.y") == -1); - assertTrue("partial.y", outofdateSources.indexOf( - "outofdate/source/1/partial.y") > -1); - String outofdateTargets = - getProject().getProperty("outofdate.targets"); - assertTrue(outofdateTargets.indexOf( - "outofdate.xml") > -1); - assertTrue(outofdateTargets.indexOf( - "outofdate/gen/1/2/file.notdone") > -1); - assertTrue(outofdateTargets.indexOf( - "outofdate/gen/1/partial.h") > -1); - assertTrue(outofdateTargets.indexOf( - "outofdate/gen/1/partial.c") == -1); - assertTrue(outofdateTargets.indexOf( - "outofdate/gen/1/done.h") == -1); - - Path sourcesPath = (Path) getProject().getReference( - "outofdate.sources.path"); - assertTrue(sourcesPath != null); - String[] sources = sourcesPath.list(); - assertTrue(sources.length == 3); - Path targetsPath = (Path) getProject().getReference( - "outofdate.targets.path"); - String[] targets = targetsPath.list(); - assertTrue(targetsPath != null); - assertTrue(targets.length == 3); - } - - public void testEmptySources() { - executeTarget("empty-sources"); - } - -} diff --git a/test/src/net/sf/antcontrib/logic/RelentlessTaskTest.java b/test/src/net/sf/antcontrib/logic/RelentlessTaskTest.java deleted file mode 100644 index a6b2246..0000000 --- a/test/src/net/sf/antcontrib/logic/RelentlessTaskTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2005 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <relentless>. - * @author Christopher Heiny - */ -public class RelentlessTaskTest extends BuildFileTest { - - public RelentlessTaskTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/relentless.xml"); - } - - public void tearDown() { - executeTarget("teardown"); - } - - public void testSimpleTasks() { - simpleTest("simpleTasks"); - } - - public void testFailTask() { - expectSpecificBuildException("failTask", "2 failed tasks", - "Relentless execution: 2 of 4 tasks failed."); - } - - public void testNoTasks() { - expectSpecificBuildException("noTasks", "missing task list", - "No tasks specified for <relentless>."); - } - - - private void simpleTest(String target) { - executeTarget(target); - int last = -1; - for (int i = 1; i < 4; i++) { - int thisIdx = getLog().indexOf("Called with param: " + i); - assertTrue(thisIdx > last); - last = thisIdx; - } - } -} diff --git a/test/src/net/sf/antcontrib/logic/SwitchTest.java b/test/src/net/sf/antcontrib/logic/SwitchTest.java deleted file mode 100644 index 28ce036..0000000 --- a/test/src/net/sf/antcontrib/logic/SwitchTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <switch>. - */ -public class SwitchTest extends BuildFileTest { - - public SwitchTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/switch.xml"); - } - - public void testNoValue() { - expectSpecificBuildException("noValue", "no value", - "Value is missing"); - } - - public void testNoChildren() { - expectSpecificBuildException("noChildren", "no children", - "No cases supplied"); - } - - public void testTwoDefaults() { - expectSpecificBuildException("twoDefaults", "two defaults", - "Cannot specify multiple default cases"); - } - - public void testNoMatch() { - expectSpecificBuildException("noMatch", "no match", - "No case matched the value foo" - + " and no default has been specified."); - } - - public void testCaseNoValue() { - expectSpecificBuildException("caseNoValue", "<case> no value", - "Value is required for case."); - } - - public void testDefault() { - executeTarget("testDefault"); - assertTrue(getLog().indexOf("In default") > -1); - assertTrue(getLog().indexOf("baz") > -1); - assertEquals(-1, getLog().indexOf("${inner}")); - assertEquals(-1, getLog().indexOf("In case")); - } - - public void testCase() { - executeTarget("testCase"); - assertTrue(getLog().indexOf("In case") > -1); - assertTrue(getLog().indexOf("baz") > -1); - assertEquals(-1, getLog().indexOf("${inner}")); - assertEquals(-1, getLog().indexOf("In default")); - } - - public void testCaseSensitive() { - executeTarget("testCaseSensitive"); - assertTrue(getLog().indexOf("In default") > -1); - assertEquals(-1, getLog().indexOf("In case")); - } - - public void testCaseInSensitive() { - executeTarget("testCaseInSensitive"); - assertTrue(getLog().indexOf("In case") > -1); - assertEquals(-1, getLog().indexOf("In default")); - } - -} diff --git a/test/src/net/sf/antcontrib/logic/ThrowTaskTest.java b/test/src/net/sf/antcontrib/logic/ThrowTaskTest.java deleted file mode 100644 index 1ad32e6..0000000 --- a/test/src/net/sf/antcontrib/logic/ThrowTaskTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <throw>. - */ -public class ThrowTaskTest extends BuildFileTest { - - public ThrowTaskTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/throw.xml"); - } - - public void testRefid() { - String message = "exception created by testcase"; - getProject().addReference("testref", new BuildException(message)); - expectSpecificBuildException("useRefid", "this is what we've put in", - message); - } - -} diff --git a/test/src/net/sf/antcontrib/logic/TimestampSelectorTest.java b/test/src/net/sf/antcontrib/logic/TimestampSelectorTest.java deleted file mode 100644 index 601c8be..0000000 --- a/test/src/net/sf/antcontrib/logic/TimestampSelectorTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <foreach>. - */ -public class TimestampSelectorTest extends BuildFileTest { - - public TimestampSelectorTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/timestampselector.xml"); - } - - public void tearDown() { - executeTarget("teardown"); - } - - public void testFileStampFL() { - simpleTest("filestamp.fl", "file2.txt"); - } - - public void testFileStampPR() { - simpleTest("filestamp.pr", "file2.txt"); - } - - public void testDirStampDL() { - simpleTest("dirstamp.dl", "dir2"); - } - - public void testDirStampPR() { - simpleTest("dirstamp.pr", "dir2"); - } - - private void simpleTest(String target, String expected) - { - executeTarget(target); - assertTrue(getLog().indexOf(expected) > -1); - } -} diff --git a/test/src/net/sf/antcontrib/logic/TryCatchTaskTest.java b/test/src/net/sf/antcontrib/logic/TryCatchTaskTest.java deleted file mode 100644 index feb8999..0000000 --- a/test/src/net/sf/antcontrib/logic/TryCatchTaskTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2001-2005 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.logic; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <trycatch>. - */ -public class TryCatchTaskTest extends BuildFileTest { - - public TryCatchTaskTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/trycatch.xml"); - } - - public void testFullTest() { - executeTarget("fullTest"); - assertEquals("Tada!", getProject().getProperty("foo")); - Object e = getProject().getReference("bar"); - assertNotNull(e); - assertTrue(e instanceof BuildException); - assertEquals("Tada!", ((BuildException) e).getMessage()); - } - - public void testTwoCatches() { - // two catch blocks were not supported prior to TryCatchTask.java v 1.4. - executeTarget("twoCatches"); - } - - public void testTwoFinallys() { - expectSpecificBuildException("twoFinallys", "two finally children", - "You must not specify more than one <finally>"); - } - - public void testTwoTrys() { - expectSpecificBuildException("twoTrys", "two try children", - "You must not specify more than one <try>"); - } - - public void testNoTry() { - expectSpecificBuildException("noTry", "no try child", - "A nested <try> element is required"); - } - - public void testNoException() { - executeTarget("noException"); - int message = getLog().indexOf("Tada!"); - int catchBlock = getLog().indexOf("In <catch>"); - int finallyBlock = getLog().indexOf("In <finally>"); - assertTrue(message > -1); - assertEquals(-1, catchBlock); - assertTrue(finallyBlock > message); - assertNull(getProject().getProperty("foo")); - assertNull(getProject().getReference("bar")); - } -} - diff --git a/test/src/net/sf/antcontrib/math/MathTest.java b/test/src/net/sf/antcontrib/math/MathTest.java deleted file mode 100644 index aba9d17..0000000 --- a/test/src/net/sf/antcontrib/math/MathTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.math; - -import net.sf.antcontrib.BuildFileTestBase; - -/** - * - * @author danson - */ -public class MathTest extends BuildFileTestBase { - - /** - * Constructor for the MathTest object - * - * @param name Description of the Parameter - */ - public MathTest( String name ) { - super( name ); - } - - /** The JUnit setup method */ - public void setUp() { - configureProject( "test/resources/math/mathtest.xml" ); - } - - /** A unit test for JUnit */ - public void test1() { - expectPropertySet("test1", "result", "18"); - } -} - diff --git a/test/src/net/sf/antcontrib/platform/OsFamilyTest.java b/test/src/net/sf/antcontrib/platform/OsFamilyTest.java deleted file mode 100644 index 9dbd237..0000000 --- a/test/src/net/sf/antcontrib/platform/OsFamilyTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.platform; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <osfamily>. - */ -public class OsFamilyTest extends BuildFileTest { - - public OsFamilyTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/platform/osfamily.xml"); - } - - public void testConsistency() { - executeTarget("consistency"); - assertPropertyEquals("consistent", "true"); - } - - public void testMissingProperty() { - expectSpecificBuildException("missingProperty", "no attribute", - "The attribute 'property' is required " - + "for the OsFamily task."); - } - -} diff --git a/test/src/net/sf/antcontrib/platform/ShellScriptTest.java b/test/src/net/sf/antcontrib/platform/ShellScriptTest.java deleted file mode 100644 index ba1a30e..0000000 --- a/test/src/net/sf/antcontrib/platform/ShellScriptTest.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.platform; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <shellscript> - * - * @author Peter Reilly - */ -public class ShellScriptTest extends BuildFileTest { - public ShellScriptTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/platform/shellscript.xml"); - staticInitialize(); - } - - public void testShHello() { - if (! hasSh) - return; - executeTarget("sh.hello"); - assertTrue(getLog().indexOf("hello world") > -1); - } - - public void testBashHello() { - if (! hasBash) - return; - executeTarget("bash.hello"); - assertTrue(getLog().indexOf("hello world") > -1); - } - - public void testShInputString() { - if (! hasSh) - return; - executeTarget("sh.inputstring"); - assertTrue(getLog().indexOf("hello world") > -1); - } - - public void testShProperty() { - if (! hasSh) - return; - executeTarget("sh.property"); - assertTrue(getLog().indexOf("this is a property") > -1); - } - - - public void testPythonHello() { - if (! hasPython) - return; - executeTarget("python.hello"); - assertTrue(getLog().indexOf("hello world") > -1); - } - - public void testPerlHello() { - if (! hasPerl) - return; - executeTarget("perl.hello"); - assertTrue(getLog().indexOf("hello world") > -1); - } - - public void testNoShell() { - expectBuildExceptionContaining( - "noshell", "Execute failed", "a shell that should not exist"); - } - - public void testSed() { - if (! hasSed) - return; - executeTarget("sed.test"); - assertTrue(getLog().indexOf("BAR bar bar bar BAR bar") > -1); - } - - public void testSetProperty() { - if (! hasSh) - return; - executeTarget("sh.set.property"); - assertPropertyEquals("sh.set.property", "hello world"); - } - - public void testTmpSuffix() { - if (! hasSh) - return; - executeTarget("sh.tmp.suffix"); - assertTrue(getLog().indexOf(".bat") > -1); - } - - public void testCmd() { - if (! hasCmd) - return; - executeTarget("cmd.test"); - assertTrue(getLog().indexOf("hello world") > -1); - } - - public void testDir() { - if (! hasBash) - return; - executeTarget("dir.test"); - assertTrue( - getProject().getProperty("dir.test.property") - .indexOf("subdir") > -1); - } - - public void testCommand() { - expectBuildExceptionContaining( - "command.test", "Attribute failed", - "Attribute command is not supported"); - } - - private static boolean initialized = false; - private static boolean hasSh = false; - private static boolean hasBash = false; - private static boolean hasPython = false; - private static boolean hasPerl = false; - private static boolean hasSed = false; - private static boolean hasCmd = false; - private static Object staticMonitor = new Object(); - - /** - * check if the env contains the shells - * sh, bash, python and perl - * assume cmd.exe exists for windows - */ - private void staticInitialize() { - synchronized (staticMonitor) { - if (initialized) - return; - initialized = true; - hasSh = hasShell("hassh"); - hasBash = hasShell("hasbash"); - hasPerl = hasShell("hasperl"); - hasPython = hasShell("haspython"); - hasSed = hasShell("hassed"); - hasCmd = hasShell("hascmd"); - - } - } - - private boolean hasShell(String target) { - try { - executeTarget(target); - return true; - } - catch (Throwable t) { - return false; - } - } - -} diff --git a/test/src/net/sf/antcontrib/process/LimitTest.java b/test/src/net/sf/antcontrib/process/LimitTest.java deleted file mode 100644 index 2e84dbd..0000000 --- a/test/src/net/sf/antcontrib/process/LimitTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.process; - -import net.sf.antcontrib.BuildFileTestBase; - -public class LimitTest extends BuildFileTestBase { - - public LimitTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/logic/limittest.xml"); - } - - public void test1() { - expectLogNotContaining("test1", "_failed_"); - } - - public void test2() { - expectLogContaining("test2", "_passed_"); - } -} diff --git a/test/src/net/sf/antcontrib/property/PathToFileSetTest.java b/test/src/net/sf/antcontrib/property/PathToFileSetTest.java deleted file mode 100644 index da4a5d4..0000000 --- a/test/src/net/sf/antcontrib/property/PathToFileSetTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.property; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <pathtofileset>. - */ -public class PathToFileSetTest extends BuildFileTest { - - public PathToFileSetTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/property/pathtofileset.xml"); - } - - public void tearDown() { - executeTarget("cleanup"); - } - - public void testSimple() { - executeTarget("simple"); - assertPropertyContains("simple.0.property", "0.java"); - assertPropertyContains("simple.0.property", "1.java"); - assertPropertyNotContains("simple.0.property", "2.java"); - assertPropertyNotContains("simple.0.property", "3.java"); - assertPropertyNotContains("simple.1.property", "0.java"); - assertPropertyNotContains("simple.1.property", "1.java"); - assertPropertyContains("simple.1.property", "2.java"); - assertPropertyContains("simple.1.property", "3.java"); - } - - public void testSimpleException() { - expectBuildExceptionContaining("simple-exception", "expect not relative to", - "is not relative to"); - } - - private void assertPropertyContains(String property, String expected) { - String result = getProject().getProperty(property); - assertTrue("property " + property + " contains " + expected, - result.indexOf(expected) != -1); - } - - private void assertPropertyNotContains(String property, String expected) { - String result = getProject().getProperty(property); - assertTrue("property " + property + " contains " + expected, - result.indexOf(expected) == -1); - } - -} diff --git a/test/src/net/sf/antcontrib/property/PropertyCopyTest.java b/test/src/net/sf/antcontrib/property/PropertyCopyTest.java deleted file mode 100644 index c2d23dc..0000000 --- a/test/src/net/sf/antcontrib/property/PropertyCopyTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.property; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <propertycopy>. - */ -public class PropertyCopyTest extends BuildFileTest { - - public PropertyCopyTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/property/propertycopy.xml"); - } - - /** - * Runs a propertyCopy without a specified name attribute. - */ - public void testMissingName() { - expectSpecificBuildException("missingName", "missing name", - "You must specify a property to set."); - } - - public void testMissingFrom() { - expectSpecificBuildException("missingFrom", "missing from", - "Missing the 'from' attribute."); - } - - public void testNonSilent() { - expectSpecificBuildException("nonSilent", "from doesn't exist", - "Property 'bar' is not defined."); - } - - public void testSilent() { - executeTarget("silent"); - assertPropertyEquals("foo", null); - } - - public void testNormal() { - executeTarget("normal"); - assertPropertyEquals("displayName", "My Organiziation"); - } -} diff --git a/test/src/net/sf/antcontrib/property/PropertySelectorTest.java b/test/src/net/sf/antcontrib/property/PropertySelectorTest.java deleted file mode 100644 index 16ad269..0000000 --- a/test/src/net/sf/antcontrib/property/PropertySelectorTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2001-2005 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.property; - -import org.apache.tools.ant.BuildFileTest; - -/** - * Testcase for <propertyselector>. - */ -public class PropertySelectorTest extends BuildFileTest { - - public PropertySelectorTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/property/propertyselector.xml"); - } - - public void testDefaultGrouping() { - simpleTest("select.test.grouping.0", - "module.Module1.id", "module.Module2.id"); - } - - public void testDefaultGrouping1() { - simpleTest("select.test.grouping.1", - "Module1", "Module2"); - } - - private void simpleTest(String target, String expected1, String expected2) - { - executeTarget(target); - String order1 = expected1 + "," + expected2; - String order2 = expected2 + "," + expected1; - int index1 = getLog().indexOf(order1); - int index2 = getLog().indexOf(order2); - assertTrue("Neither '" + order1 + "' nor '" + order2 - + "' was found in '" + getLog() + "'", - index1 > -1 || index2 > -1); - } - -} diff --git a/test/src/net/sf/antcontrib/property/VariableTest.java b/test/src/net/sf/antcontrib/property/VariableTest.java deleted file mode 100644 index d54c111..0000000 --- a/test/src/net/sf/antcontrib/property/VariableTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.property; - -import net.sf.antcontrib.BuildFileTestBase; - - -public class VariableTest extends BuildFileTestBase { - - public VariableTest(String name) { - super(name); - } - - public void setUp() { - configureProject("test/resources/property/variabletest.xml"); - } - - public void test1() { - expectPropertySet("test1", "x", "6"); - } - - public void test2() { - expectPropertySet("test2", "x", "12"); - } - - public void test3() { - expectPropertySet("test3", "x", "6 + 12"); - } - - public void test4() { - expectPropertySet("test4", "x", "6"); - } - - public void test5() { - expectPropertySet("test5", "str", "I am a string."); - } - - public void test6() { - expectPropertySet("test6", "x", "Today is blue."); - } - - public void test7() { - expectPropertySet("test7", "x", "6"); - } - - /* TODO: depends on the Antelope <if>, need to adjust to use the ant-contrib <if> - public void test8() { - expectPropertySet("test8", "x", "12"); - expectLogContaining("test8", "12"); - } - */ - public void test9() { - expectPropertyUnset("test9", "i"); - } - - public void test10() { - expectPropertySet("test10", "x", "xxx"); - } -} diff --git a/test/src/net/sf/antcontrib/walls/CompileWithWallsTest.java b/test/src/net/sf/antcontrib/walls/CompileWithWallsTest.java deleted file mode 100644 index fe6a203..0000000 --- a/test/src/net/sf/antcontrib/walls/CompileWithWallsTest.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. - * - * 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 net.sf.antcontrib.walls; - -import java.io.File; - -import org.apache.tools.ant.BuildFileTest; - -import junit.framework.TestSuite; -import junit.textui.TestRunner; - -/** - * BIG NOTE*************************************************** - * Always expect specific exceptions. Most of these test cases when - * first submitted were not and therefore were not testing what they said - * they were testing. Exceptions were being caused by other things and the - * tests were still passing. Now all tests expect a specific exception - * so if any other is thrown we will fail the test case. - * ************************************************************ - * - * Testcase for <propertycopy>. - */ -public class CompileWithWallsTest extends BuildFileTest { - - private String baseDir = "test"+File.separator - +"resources"+File.separator - +"walls"+File.separator; - private String c = File.separator; - - public CompileWithWallsTest(String name) { - super(name); - } - - public void setUp() { - - configureProject("test/resources/walls/compilewithwalls.xml"); -// project.addBuildListener(new LogListener()); - } -// protected class LogListener implements BuildListener { -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#buildStarted(org.apache.tools.ant.BuildEvent) -// */ -// public void buildStarted(BuildEvent event) { -// // TODO Auto-generated method stub -// -// } -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#buildFinished(org.apache.tools.ant.BuildEvent) -// */ -// public void buildFinished(BuildEvent event) { -// // TODO Auto-generated method stub -// -// } -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#targetStarted(org.apache.tools.ant.BuildEvent) -// */ -// public void targetStarted(BuildEvent event) { -// // TODO Auto-generated method stub -// -// } -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#targetFinished(org.apache.tools.ant.BuildEvent) -// */ -// public void targetFinished(BuildEvent event) { -// // TODO Auto-generated method stub -// -// } -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#taskStarted(org.apache.tools.ant.BuildEvent) -// */ -// public void taskStarted(BuildEvent event) { -// // TODO Auto-generated method stub -// -// } -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#taskFinished(org.apache.tools.ant.BuildEvent) -// */ -// public void taskFinished(BuildEvent event) { -// // TODO Auto-generated method stub -// -// } -// -// /* (non-Javadoc) -// * @see org.apache.tools.ant.BuildListener#messageLogged(org.apache.tools.ant.BuildEvent) -// */ -// public void messageLogged(BuildEvent event) { -// -// System.out.println(event.getException()); -// System.out.println("aaa"); -// } -// -// } - - public void tearDown() { - executeTarget("cleanup"); - -// System.out.println(getFullLog()); -// System.out.println("std out. from ant build begin--------------"); -// System.out.println(getOutput()); -// System.out.println("std.out. from ant build end----------------"); -// System.out.println("std err. from ant build begin--------------"); -// System.out.println(getError()); -// System.out.println("std.err. from ant build end----------------"); - } - - public void testTooManyNestedWallElements() { - expectSpecificBuildException("testTooManyNestedWallElements" - , "TooManyNestedWallElements" - , "compilewithwalls task only supports one nested walls element or one walls attribute"); - } - - public void testFakeTest() { - //this is being deprecated, tests no longer really needed. - } -// public void testTooManyNestedJavacElements() { -// expectSpecificBuildException("testTooManyNestedJavacElements" -// , "TooManyNestedJavacElements" -// , "compilewithwalls task only supports one nested javac element"); -// } -// -// public void testNoWallElement() { -// expectSpecificBuildException("testNoWallElement" -// , "NoWallElement" -// , "There must be a nested walls element"); -// } -// -// public void testNoJavacElement() { -// expectSpecificBuildException("testNoJavacElement" -// , "NoJavacElement" -// , "There must be a nested javac element"); -// } -// -// public void testMoreThanOneSrcDirInJavac() { -// executeTarget("testMoreThanOneSrcDirInJavac"); -// } -// -// public void testNoSrcDirInJavac() { -// expectSpecificBuildException("testNoSrcDirInJavac" -// , "NoSrcDirInJavac" -// , "Javac inside compilewithwalls must have a srcdir specified"); -// } -// -// public void testIntermediaryDirAndDestDirSame() { -// expectSpecificBuildException("testIntermediaryDirAndDestDirSame" -// , "IntermediaryDirAndDestDirSame" -// , "intermediaryBuildDir attribute cannot be specified\n" -// +"to be the same as destdir or inside desdir of the javac task.\n" -// +"This is an intermediary build directory only used by the\n" -// +"compilewithwalls task, not the class file output directory.\n" -// +"The class file output directory is specified in javac's destdir attribute"); -// } -// -// public void testIntermediaryDirInsideDestDir() { -// expectSpecificBuildException("testIntermediaryDirInsideDestDir" -// , "IntermediaryDirInsideDestDir" -// , "intermediaryBuildDir attribute cannot be specified\n" -// +"to be the same as destdir or inside desdir of the javac task.\n" -// +"This is an intermediary build directory only used by the\n" -// +"compilewithwalls task, not the class file output directory.\n" -// +"The class file output directory is specified in javac's destdir attribute"); -// } -// -// public void testPackageDoesntEndWithStar() { -// expectSpecificBuildException("testPackageDoesntEndWithStar" -// , "PackageDoesntEndWithStar" -// , "The package='biz.xsoftware' must end with " -// + ".* or .** such as biz.xsoftware.* or " -// + "biz.xsoftware.**" ); -// } -// -// public void testPackageDoesntHaveSlash() { -// expectSpecificBuildException("testPackageDoesntHaveSlash" -// , "PackageDoesntHaveSlash" -// ,"A package name cannot contain '\\' or '/' like package=" -// + "biz/xsoftware.*\nIt must look like biz.xsoftware.* for example"); -// } -// -// public void testDependsOnNonExistPackage() { -// expectSpecificBuildException("testDependsOnNonExistPackage" -// , "DependsOnNonExistPackage" -// , "package name=modA did not have modB" -// + " listed before it and cannot compile without it"); -// } -// -// public void testDependsOnPackageAfter() { -// expectSpecificBuildException("testDependsOnPackageAfter" -// , "DependsOnPackageAfter" -// , "package name=modA did not have modB" -// + " listed before it and cannot compile without it"); -// } -// -// public void testPackageABreakingWhenAIsCompiledFirst() { -// expectSpecificBuildException("testPackageABreakingWhenAIsCompiledFirst" -// , "PackageABreakingWhenAIsCompiledFirst" -// , "Compile failed; see the compiler error output for details."); -// } -// -// -// /** -// * This test case tests when modB depends on modA but it was -// * not specified in the walls so modA is not in modB's path. -// * The build should then fail until they change the build.xml -// * so modB depends on modA in the walls element. -// */ -// public void testPackageBBreakingWhenAIsCompiledFirst() { -// -// expectSpecificBuildException("testPackageBBreakingWhenAIsCompiledFirst" -// , "PackageBBreakingWhenAIsCompiledFirst" -// , "Compile failed; see the compiler error output for details."); -// -// //modA should have been compiled successfully, it is only modB that -// //fails. It is very important we make sure A got compiled otherwise -// //we are not testing the correct behavior and the test would be wrong. -// ensureClassFileExists("testB"+c+"mod"+c+"modA"+c+"ModuleA.class", true); -// ensureClassFileExists("testB"+c+"mod"+c+"modB"+c+"ModuleB.class", false); -// } -// -// public void testCompileOfAllUsingDepends() { -// ensureClassFileExists("testC"+c+"mod"+c+"Module.class", false); -// //make sure we are testing the correct thing and Module.java exists! -// ensureJavaFileExists("testC"+c+"mod"+c+"Module.java", true); -// -// executeTarget("testCompileOfAllUsingDepends"); -// -// //must test class files were actually created afterwards. -// //The build might pass with no class files if the task is -// //messed up. -// ensureClassFileExists("testC"+c+"mod"+c+"Module.class", true); -// -// } -////--------------------------------------------------------- -//// -//// The following tests are all just repeats of some of the above tests -//// except the below tests use External walls file and the above tests -//// don't. -//// -////--------------------------------------------------------- -// -// public void testDependsOnPackageAfterExternalWalls() { -// expectSpecificBuildException("testDependsOnPackageAfterExternalWalls" -// , "DependsOnPackageAfterExternalWalls" -// , "package name=modA did not have modB" -// + " listed before it and cannot compile without it"); -// } -// -// /** -// * This test case tests when modB depends on modA but it was -// * not specified in the walls so modA is not in modB's path. -// * The build should then fail until they change the build.xml -// * so modB depends on modA in the walls element. -// */ -// public void testPackageBBreakingWhenAIsCompiledFirstExternalWalls() { -// ensureClassFileExists("testB"+c+"mod"+c+"modA"+c+"ModuleA.class", false); -// ensureJavaFileExists("testB"+c+"mod"+c+"modB"+c+"ModuleB.java", true); -// -// expectSpecificBuildException("testPackageBBreakingWhenAIsCompiledFirst" -// , "PackageBBreakingWhenAIsCompiledFirst" -// , "Compile failed; see the compiler error output for details."); -// -// //modA should have been compiled successfully, it is only modB that -// //fails. It is very important we make sure A got compiled otherwise -// //we are not testing the correct behavior and the test would be wrong. -// ensureClassFileExists("testB"+c+"mod"+c+"modA"+c+"ModuleA.class", true); -// ensureClassFileExists("testB"+c+"mod"+c+"modB"+c+"ModuleB.class", false); -// } -// -// public void testCompileOfAllUsingDependsExternalWalls() { -// ensureClassFileExists("testC"+c+"mod"+c+"Module.class", false); -// ensureJavaFileExists("testC"+c+"mod"+c+"Module.java", true); -// executeTarget("testCompileOfAllUsingDependsExternalWalls"); -// //must test class files were actually created afterwards. -// //The build might pass with no class files if the task is -// //messed up. -// ensureClassFileExists("testC"+c+"mod"+c+"Module.class", true); -// } - - private void ensureJavaFileExists(String file, boolean shouldExist) { - - //must test that it is testing the correct directory. - //It wasn't before. - String javaFile = baseDir+file; - File f1 = new File(javaFile); - if(shouldExist) - assertTrue("The java file="+f1.getAbsolutePath()+" didn't exist, we can't run this test. It will pass with false results", - f1.exists()); - else - assertTrue("The java file="+f1.getAbsolutePath()+" exists and shouldn't, we can't run this test. It will pass with false results", - !f1.exists()); - } - - private void ensureClassFileExists(String file, boolean shouldExist) { - - String classFile = baseDir - +"compilewithwalls"+File.separator - +"classes"+File.separator - +file; - - File f1 = new File(classFile); - if(shouldExist) - assertTrue("The class file="+f1.getAbsolutePath()+" didn't get created, No build exception\nwas thrown, but the build failed because a class\nfile should have been created", - f1.exists()); - else - assertTrue("The class file="+f1.getAbsolutePath()+" exists and shouldn't\nTest may be inaccurate if this file already exists...correct the test", - !f1.exists()); - } - - public static void main(String[] args) { - TestSuite suite = new TestSuite(CompileWithWallsTest.class); - TestRunner.run(suite); - } -} diff --git a/test/src/org/apache/tools/ant/BuildFileTest.java b/test/src/org/apache/tools/ant/BuildFileTest.java deleted file mode 100644 index 0f950e7..0000000 --- a/test/src/org/apache/tools/ant/BuildFileTest.java +++ /dev/null @@ -1,478 +0,0 @@ -/*
- * Copyright 2001-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.
- *
- */
-
-package org.apache.tools.ant;
-
-import junit.framework.TestCase;
-import org.apache.tools.ant.Project;
-import java.io.File;
-import java.io.PrintStream;
-import java.net.URL;
-
-/**
- * A BuildFileTest is a TestCase which executes targets from an Ant buildfile
- * for testing.
- *
- * This class provides a number of utility methods for particular build file
- * tests which extend this class.
- *
- */
-public abstract class BuildFileTest extends TestCase {
-
- protected Project project;
-
- private StringBuffer logBuffer;
- private StringBuffer fullLogBuffer;
- private StringBuffer outBuffer;
- private StringBuffer errBuffer;
- private BuildException buildException;
-
- /**
- * Constructor for the BuildFileTest object
- *
- *@param name string to pass up to TestCase constructor
- */
- public BuildFileTest(String name) {
- super(name);
- }
-
- /**
- * run a target, expect for any build exception
- *
- *@param target target to run
- *@param cause information string to reader of report
- */
- protected void expectBuildException(String target, String cause) {
- expectSpecificBuildException(target, cause, null);
- }
-
- /**
- * Assert that only the given message has been logged with a
- * priority >= INFO when running the given target.
- */
- protected void expectLog(String target, String log) {
- executeTarget(target);
- String realLog = getLog();
- assertEquals(log, realLog);
- }
-
- /**
- * Assert that the given substring is in the log messages
- */
-
- protected void assertLogContaining(String substring) {
- String realLog = getLog();
- assertTrue("expecting log to contain \"" + substring + "\" log was \""
- + realLog + "\"",
- realLog.indexOf(substring) >= 0);
- }
-
- /**
- * Assert that the given message has been logged with a priority
- * >= INFO when running the given target.
- */
- protected void expectLogContaining(String target, String log) {
- executeTarget(target);
- assertLogContaining(log);
- }
-
- /**
- * Gets the log the BuildFileTest object.
- * only valid if configureProject() has
- * been called.
- * @pre logBuffer!=null
- * @return The log value
- */
- protected String getLog() {
- return logBuffer.toString();
- }
-
- /**
- * Assert that the given message has been logged with a priority
- * >= DEBUG when running the given target.
- */
- protected void expectDebuglog(String target, String log) {
- executeTarget(target);
- String realLog = getFullLog();
- assertEquals(log, realLog);
- }
-
- /**
- * Gets the log the BuildFileTest object.
- * only valid if configureProject() has
- * been called.
- * @pre fullLogBuffer!=null
- * @return The log value
- */
- protected String getFullLog() {
- return fullLogBuffer.toString();
- }
-
- /**
- * execute the target, verify output matches expectations
- *
- *@param target target to execute
- *@param output output to look for
- */
-
- protected void expectOutput(String target, String output) {
- executeTarget(target);
- String realOutput = getOutput();
- assertEquals(output, realOutput.trim());
- }
-
- /**
- * execute the target, verify output matches expectations
- * and that we got the named error at the end
- *@param target target to execute
- *@param output output to look for
- *@param error Description of Parameter
- */
-
- protected void expectOutputAndError(String target, String output, String error) {
- executeTarget(target);
- String realOutput = getOutput();
- assertEquals(output, realOutput);
- String realError = getError();
- assertEquals(error, realError);
- }
-
- protected String getOutput() {
- return cleanBuffer(outBuffer);
- }
-
- protected String getError() {
- return cleanBuffer(errBuffer);
- }
-
- protected BuildException getBuildException() {
- return buildException;
- }
-
- private String cleanBuffer(StringBuffer buffer) {
- StringBuffer cleanedBuffer = new StringBuffer();
- boolean cr = false;
- for (int i = 0; i < buffer.length(); i++) {
- char ch = buffer.charAt(i);
- if (ch == '\r') {
- cr = true;
- continue;
- }
-
- if (!cr) {
- cleanedBuffer.append(ch);
- } else {
- cleanedBuffer.append(ch);
- }
- }
- return cleanedBuffer.toString();
- }
-
- /**
- * set up to run the named project
- *
- * @param filename name of project file to run
- */
- protected void configureProject(String filename) throws BuildException {
- configureProject(filename, Project.MSG_DEBUG);
- }
-
- /**
- * set up to run the named project
- *
- * @param filename name of project file to run
- */
- protected void configureProject(String filename, int logLevel)
- throws BuildException {
- logBuffer = new StringBuffer();
- fullLogBuffer = new StringBuffer();
- project = new Project();
- project.init();
- project.setUserProperty( "ant.file" , new File(filename).getAbsolutePath() );
- project.addBuildListener(new AntTestListener(logLevel));
- ProjectHelper.configureProject(project, new File(filename));
- }
-
- /**
- * execute a target we have set up
- * @pre configureProject has been called
- * @param targetName target to run
- */
- protected void executeTarget(String targetName) {
- PrintStream sysOut = System.out;
- PrintStream sysErr = System.err;
- try {
- sysOut.flush();
- sysErr.flush();
- outBuffer = new StringBuffer();
- PrintStream out = new PrintStream(new AntOutputStream(outBuffer));
- System.setOut(out);
- errBuffer = new StringBuffer();
- PrintStream err = new PrintStream(new AntOutputStream(errBuffer));
- System.setErr(err);
- logBuffer = new StringBuffer();
- fullLogBuffer = new StringBuffer();
- buildException = null;
- project.executeTarget(targetName);
- } finally {
- System.setOut(sysOut);
- System.setErr(sysErr);
- }
-
- }
-
- /**
- * Get the project which has been configured for a test.
- *
- * @return the Project instance for this test.
- */
- protected Project getProject() {
- return project;
- }
-
- /**
- * get the directory of the project
- * @return the base dir of the project
- */
- protected File getProjectDir() {
- return project.getBaseDir();
- }
-
- /**
- * run a target, wait for a build exception
- *
- *@param target target to run
- *@param cause information string to reader of report
- *@param msg the message value of the build exception we are waiting for
- set to null for any build exception to be valid
- */
- protected void expectSpecificBuildException(String target, String cause, String msg) {
- try {
- executeTarget(target);
- } catch (org.apache.tools.ant.BuildException ex) {
- buildException = ex;
- if ((null != msg) && (!ex.getMessage().equals(msg))) {
- fail("Should throw BuildException because '" + cause
- + "' with message '" + msg
- + "' (actual message '" + ex.getMessage() + "' instead)");
- }
- return;
- }
- fail("Should throw BuildException because: " + cause);
- }
-
- /**
- * run a target, expect an exception string
- * containing the substring we look for (case sensitive match)
- *
- *@param target target to run
- *@param cause information string to reader of report
- *@param contains substring of the build exception to look for
- */
- protected void expectBuildExceptionContaining(String target, String cause, String contains) {
- try {
- executeTarget(target);
- } catch (org.apache.tools.ant.BuildException ex) {
- buildException = ex;
- if ((null != contains) && (ex.getMessage().indexOf(contains) == -1)) {
- fail("Should throw BuildException because '" + cause + "' with message containing '" + contains + "' (actual message '" + ex.getMessage() + "' instead)");
- }
- return;
- }
- fail("Should throw BuildException because: " + cause);
- }
-
-
- /**
- * call a target, verify property is as expected
- *
- * @param target build file target
- * @param property property name
- * @param value expected value
- */
-
- protected void expectPropertySet(String target, String property, String value) {
- executeTarget(target);
- assertPropertyEquals(property, value);
- }
-
- /**
- * assert that a property equals a value; comparison is case sensitive.
- * @param property property name
- * @param value expected value
- */
- protected void assertPropertyEquals(String property, String value) {
- String result = project.getProperty(property);
- assertEquals("property " + property,value,result);
- }
-
- /**
- * assert that a property equals "true"
- * @param property property name
- */
- protected void assertPropertySet(String property) {
- assertPropertyEquals(property, "true");
- }
-
- /**
- * assert that a property is null
- * @param property property name
- */
- protected void assertPropertyUnset(String property) {
- assertPropertyEquals(property, null);
- }
-
-
- /**
- * call a target, verify named property is "true".
- *
- * @param target build file target
- * @param property property name
- */
- protected void expectPropertySet(String target, String property) {
- expectPropertySet(target, property, "true");
- }
-
-
- /**
- * call a target, verify property is null
- * @param target build file target
- * @param property property name
- */
- protected void expectPropertyUnset(String target, String property) {
- expectPropertySet(target, property, null);
- }
-
- /**
- * Retrieve a resource from the caller classloader to avoid
- * assuming a vm working directory. The resource path must be
- * relative to the package name or absolute from the root path.
- * @param resource the resource to retrieve its url.
- * @throws AssertionFailureException if resource is not found.
- */
- protected URL getResource(String resource){
- URL url = getClass().getResource(resource);
- assertNotNull("Could not find resource :" + resource, url);
- return url;
- }
-
- /**
- * an output stream which saves stuff to our buffer.
- */
- private static class AntOutputStream extends java.io.OutputStream {
- private StringBuffer buffer;
-
- public AntOutputStream( StringBuffer buffer ) {
- this.buffer = buffer;
- }
-
- public void write(int b) {
- buffer.append((char)b);
- }
- }
-
- /**
- * our own personal build listener
- */
- private class AntTestListener implements BuildListener {
- private int logLevel;
-
- /**
- * Constructs a test listener which will ignore log events
- * above the given level
- */
- public AntTestListener(int logLevel) {
- this.logLevel = logLevel;
- }
-
- /**
- * Fired before any targets are started.
- */
- public void buildStarted(BuildEvent event) {
- }
-
- /**
- * Fired after the last target has finished. This event
- * will still be thrown if an error occured during the build.
- *
- * @see BuildEvent#getException()
- */
- public void buildFinished(BuildEvent event) {
- }
-
- /**
- * Fired when a target is started.
- *
- * @see BuildEvent#getTarget()
- */
- public void targetStarted(BuildEvent event) {
- //System.out.println("targetStarted " + event.getTarget().getName());
- }
-
- /**
- * Fired when a target has finished. This event will
- * still be thrown if an error occured during the build.
- *
- * @see BuildEvent#getException()
- */
- public void targetFinished(BuildEvent event) {
- //System.out.println("targetFinished " + event.getTarget().getName());
- }
-
- /**
- * Fired when a task is started.
- *
- * @see BuildEvent#getTask()
- */
- public void taskStarted(BuildEvent event) {
- //System.out.println("taskStarted " + event.getTask().getTaskName());
- }
-
- /**
- * Fired when a task has finished. This event will still
- * be throw if an error occured during the build.
- *
- * @see BuildEvent#getException()
- */
- public void taskFinished(BuildEvent event) {
- //System.out.println("taskFinished " + event.getTask().getTaskName());
- }
-
- /**
- * Fired whenever a message is logged.
- *
- * @see BuildEvent#getMessage()
- * @see BuildEvent#getPriority()
- */
- public void messageLogged(BuildEvent event) {
- if (event.getPriority() > logLevel) {
- // ignore event
- return;
- }
-
- if (event.getPriority() == Project.MSG_INFO ||
- event.getPriority() == Project.MSG_WARN ||
- event.getPriority() == Project.MSG_ERR) {
- logBuffer.append(event.getMessage());
- }
- fullLogBuffer.append(event.getMessage());
-
- }
- }
-
-
-}
|