1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Added support for a messenger test suite. To write messenger-assuming tests, just use the MessengerXXXTest.java naming convention. From the build dir call 'ant test.messenger'. All host/port/user properties have default values in build.xml and you should edit the values in build.properties to match your environment.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2044 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Bill Lynch 2003-08-19 17:44:45 +00:00 committed by blynch
parent 60b74246c4
commit 72879bdf03
2 changed files with 77 additions and 2 deletions

15
build/build.properties Normal file
View file

@ -0,0 +1,15 @@
#
# $RCSfile$
# $Revision$
# $Date$
#
# Test properties. Uncomment these to override default values declared
# in the build.xml file.
# test.host=
# test.port=
# test.admin.username=
# test.admin.password=
# test.admin.resource=
# test.smack.debug=

View file

@ -11,9 +11,21 @@
<project name="Smack" default="all" basedir="..">
<!-- TASKDEFS -->
<!-- ======================================================================================= -->
<!-- ======================================================================================= -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/build/ant-contrib.jar"/>
</classpath>
</taskdef>
<!-- PROPERTIES -->
<!-- ======================================================================================= -->
<property file="${basedir}/build/build.properties" />
<property name="compile.dir" value="${basedir}/classes" />
<property name="compile.test.dir" value="${basedir}/classes-test" />
<property name="jar.dest.dir" value="${basedir}" />
@ -26,6 +38,27 @@
<property name="version.revision" value="0" />
<property name="version.name" value="${version.major}.${version.minor}.${version.revision}" />
<!-- Test props - override these defaults in the properties file or in command line -->
<property name="test.host" value="localhost" />
<property name="test.port" value="5222" />
<property name="test.admin.username" value="admin" />
<property name="test.admin.password" value="admin" />
<property name="test.admin.resource" value="Test" />
<property name="test.smack.debug" value="false" />
<!-- PATHS, DEPENDIENCIES, PATTERNS -->
<!-- ======================================================================================= -->
<!-- ======================================================================================= -->
<patternset id="test.cases">
<include name="org/jivesoftware/smack/**/*Test.java" />
<exclude name="org/jivesoftware/smack/**/Messenger*Test.java" />
</patternset>
<patternset id="messenger.test.cases">
<include name="org/jivesoftware/smack/**/Messenger*Test.java" />
</patternset>
<!-- TARGETS -->
<!-- ======================================================================================= -->
@ -142,12 +175,29 @@
<!-- test -->
<!-- ======================================================================================= -->
<target name="test" depends="compile, jar-test" unless="no.test">
<property name="test.messenger" value="false" />
<if>
<not><equals arg1="test.messenger" arg2="true" /></not>
<then>
<property name="test.classes" value="test.cases" />
</then>
</if>
<junit printsummary="on"
fork="false"
haltonfailure="false"
failureproperty="tests.failed"
showoutput="true">
<sysproperty key="smack.test.host" value="${test.host}" />
<sysproperty key="smack.test.port" value="${test.port}" />
<sysproperty key="smack.test.admin.username" value="${test.admin.username}" />
<sysproperty key="smack.test.admin.password" value="${test.admin.password}" />
<sysproperty key="smack.test.admin.resource" value="${test.admin.resource}" />
<sysproperty key="smack.debug" value="${test.smack.debug}" />
<classpath>
<fileset dir="${build.lib.dir}">
<include name="*.jar"/>
@ -165,12 +215,22 @@
<batchtest>
<fileset dir="${basedir}/test">
<include name="org/jivesoftware/smack/**/*Test.java"/>
<patternset refid="${test.classes}" />
</fileset>
</batchtest>
</junit>
<fail if="tests.failed" message="Tests failed, see test log." />
<fail if="tests.failed" message="** Tests failed, see test log. **" />
</target>
<!-- test -->
<!-- ======================================================================================= -->
<target name="test.messenger" depends="compile, jar-test" unless="no.test">
<antcall target="test" inheritall="true" inheritrefs="true">
<param name="test.messenger" value="true" />
<param name="test.classes" value="messenger.test.cases" />
</antcall>
</target>