merge
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 18 Sep 2015 14:06:37 +0000 (15:06 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 18 Sep 2015 14:06:37 +0000 (15:06 +0100)
build.xml
doc/UnitTesting.html
utils/ant-contrib-1.0b3.jar [new file with mode: 0644]
utils/i18nAnt.xml [new file with mode: 0755]
utils/jalview_testng.xml [deleted file]

index bb743d6..2b81b21 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -19,7 +19,7 @@
 -->
 <project name="jalviewX" default="usage" basedir=".">
   <target name="help" depends="usage" />
-  <target name="usage">
+  <target name="usage" depends="init">
     <echo message="~~~Jalview Ant build.xml Usage~~~~" />
     <echo message="Targets include:" />
     <echo message="usage - default target, displays this message" />
@@ -30,6 +30,8 @@
     <echo message="              this needs a keystore and key. See docs/building.html for more information." />
     <echo message="compileApplet - compiles all necessary files for Applet" />
     <echo message="makeApplet - compiles, then packages and obfuscates the Applet" />
+    <echo message="testng - run jalview's tests via testNG. Default group is '${testng-groups}'" />
+    <echo message="      you can specify particular test groups as a list via -Dtestng-groups=" />
     <echo message="See docs/building.html and the comments in build file for other targets." />
     <echo message="note: compile and makeApplet require the property java118.home to be set to point to a java 1.1.8 jdk." />
     <echo message="Useful -D flags: -Ddonotobfuscate will prevent applet obfuscation" />
         <include name="*.jar"/>
       </fileset> -->
       </path>
-       
+
     <!-- Jalview Version String displayed by application on startup and used to check for updates -->
     <property name="JALVIEW_VERSION" value="DEVELOPMENT" />
-       
+
     <property name="INSTALLATION" value="Source" />
-       
+
     <!-- 2.4 (VAMSAS)" -->
     <!-- Include debugging information in javac true or false -->
     <property name="javac.debug" value="true" />
     <!-- Key Password -->
     <property name="jalview.key.pass" value="alignmentisfun" />
 
+    <property name="testng-groups" value="Functional" />
+
     <!-- Don't change anything below here unless you know what you are doing! -->
     <!-- Url path for WebStart in JNLP file -->
     <property name="WebStartLocation" value="http://www.jalview.org/webstart" />
     <!-- Webstart Image - looked for in resources/images -->
-    <property name="WebStartImage" value="JalviewLogo_big.png"/>
+    <property name="WebStartImage" value="JalviewLogo_big.png" />
     <!-- J2SE version needed for webstart launch -->
     <!-- Anne's version needs 1.7 - should rebuild VARNA to java 1.6 for release -->
-    <property name="j2sev" value="1.7+"/>
-       <!-- Java Compilation settings - source and target javac version -->
-       <property name="javac.source" value="1.7"/>
-       <property name="javac.target" value="1.7"/>
-               
+    <property name="j2sev" value="1.7+" />
+    <!-- Java Compilation settings - source and target javac version -->
+    <property name="javac.source" value="1.7" />
+    <property name="javac.target" value="1.7" />
+
     <!-- Permissions for running Java applets and applications. -->
     <!-- Defaults are those suitable for deploying jalview webstart www.jalview.org -->
     <property name="application.codebase" value="*.jalview.org" />
     <property name="jsonSimple" value="json_simple-1.1.jar" />
     <property name="javaJson" value="java-json.jar" />
     <property name="jalviewLiteJar" value="jalviewApplet.jar" />
-       <property name="reportDir" value="test-reports" />
-       <property name="testDir" value="test" />
-       <property name="testOutputDir" value="tests" />
+    <property name="reportDir" value="test-reports" />
+    <property name="testDir" value="test" />
+    <property name="testOutputDir" value="tests" />
     <!-- switch to indicate if we should obfuscate jalviewLite -->
     <!-- <property name="donotobfuscate" value="true"/> -->
     <!-- switch to exclude associations from generated jnlp files -->
         <include name="**/*.jar" />
       </fileset>
       <fileset dir="${java.home}/lib">
-        <include name="plugin.jar"/>
+        <include name="plugin.jar" />
       </fileset>
       <fileset dir="appletlib">
         <!-- the JmolApplet includes the JmolApplet console and the application javac seems to always try and build all packages 
         <include name="${jmolJar}" />
         <include name="${varnaJar}" />
       </fileset>
-
+    </path>
+    <path id="test.classpath">
+      <pathelement path="${outputDir}" />
+      <path refid="build.classpath" />
     </path>
     <property name="source.dist.name" value="${basedir}/jalview-src.tar.gz" />
     <!-- The Location of the java 1.1.8 jdk -->
     <!-- <property name="applet.jre.tools" value="${java118.home}/lib/classes.zip" />
                -->
     <!-- jre for 1.4 version -->
-    <property name="applet.jre.tools" value="${java.home}/lib/rt.jar"/>
+    <property name="applet.jre.tools" value="${java.home}/lib/rt.jar" />
 
     <!-- the classpath for building the 1.1 applet -->
     <path id="jalviewlite.deps">
         <include name="lib/classes.zip" />
       </fileset>
       <fileset dir="${java.home}/lib">
-        <include name="plugin.jar"/>
+        <include name="plugin.jar" />
       </fileset>
       <pathelement location="appletlib/${jmolJar}" />
       <pathelement location="lib/${varnaJar}" />
       <pathelement location="lib/${jsoup}" />
       <pathelement location="lib/${jsonSimple}" />
       <pathelement location="lib/${javaJson}" />
-      
+
     </path>
     <!-- default location for outputting javadoc -->
-    <property name="javadocDir" value="${packageDir}/javadoc"/>
+    <property name="javadocDir" value="${packageDir}/javadoc" />
   </target>
 
 
     <tstamp prefix="build">
       <format property="date" pattern="dd MMMM yyyy" />
     </tstamp>
-    <exec executable="/usr/bin/git" outputproperty="git.commit"  failifexecutionfails="false">
-      <arg value="rev-parse"/>
-      <arg value="--short"/>
-      <arg value="HEAD"/>
+    <exec executable="/usr/bin/git" outputproperty="git.commit" failifexecutionfails="false">
+      <arg value="rev-parse" />
+      <arg value="--short" />
+      <arg value="HEAD" />
     </exec>
     <exec executable="/usr/bin/git" outputproperty="git.branch" failifexecutionfails="false">
-      <arg value="rev-parse"/>
-      <arg value="--abbrev-ref"/>
-      <arg value="HEAD"/>
+      <arg value="rev-parse" />
+      <arg value="--abbrev-ref" />
+      <arg value="HEAD" />
     </exec>
     <properties file="${outputDir}/.build_properties">
       <header>
           ---Jalview Build Details---
-        </header>      
+        </header>
       <property name="VERSION" value="${JALVIEW_VERSION}" />
       <property name="INSTALLATION" value="${INSTALLATION} git-commit:${git.commit} [${git.branch}]" />
       <property name="BUILD_DATE" value="${build.date}" />
 
   <target name="clean" depends="init">
     <!-- not efficient yet. -->
-    <delete dir="${outputDir}" includes="*,**/*"/>
+    <delete dir="${outputDir}" includes="*,**/*" />
   </target>
 
   <target name="distclean" depends="init, clean">
       <exclude name="com/stevesoft/**" />
     </javac>
   </target>
-  
-  
+
+
   <target name="testclean" depends="init">
-    <delete dir="${testOutputDir}" includes="*,**/*"/>
+    <delete dir="${testOutputDir}" includes="*,**/*" />
   </target>
-  
-  <target name="prepareTests" depends="init">
-       <mkdir dir="${testOutputDir}" />
-       <copy todir="${testOutputDir}">
-               <fileset dir=".">
-                       <include name="${docDir}/**/*.*" />
-                       <include name="${helpDir}/**/*.*" />
-                       <include name="${libDir}/*.jar" />
-               </fileset>
-               <fileset dir="${resourceDir}">
-                       <include name="**/*.*" />
-               </fileset>
-       </copy>
-  </target>  
-  
-  <target name="buildTests" depends="prepareTests">
-       <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${testOutputDir}"
-               debug="${javac.debug}" classpathref="build.classpath" includeantruntime="false" >               
-       </javac>
-       <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}"
-               debug="${javac.debug}" classpathref="build.classpath" includeantruntime="false" >
-       </javac>
+
+  <target name="prepareTests" depends="init,clean">
+    <mkdir dir="${testOutputDir}" />
   </target>
-  
-  <taskdef name="testng" classname="org.testng.TestNGAntTask" >            
-       <classpath location="utils/testnglibs/testng.jar" />
-  </taskdef>
-  
+
+  <target name="buildTests" depends="build,buildindices,prepareTests">
+    <javac source="${javac.source}" target="${javac.target}" srcdir="${testDir}" destdir="${testOutputDir}" debug="${javac.debug}" classpathref="test.classpath" includeantruntime="false">
+    </javac>
+  </target>
+
+  <taskdef resource="testngtasks" classpath="utils/testnglibs/testng.jar" />
+
   <target name="testng" depends="buildTests">
-       <testng classpathref="build.classpath" outputDir="${reportDir}"
-               haltOnFailure="false">
-               <classpath location="${testOutputDir}" />
-               <xmlfileset dir="utils" includes="jalview_testng.xml" />
-       </testng>
+    <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng"
+      verbose="2">
+      <classpath>
+        <pathelement location="${testOutputDir}" />
+        <path refid="test.classpath" />
+      </classpath>
+      <classfileset dir="${testOutputDir}" includes="**/*.class" />
+    </testng>
   </target>
-  
+
   <target name="buildindices" depends="init, prepare" unless="help.uptodate">
     <java classname="com.sun.java.help.search.Indexer" classpathref="build.classpath" fork="true" dir="${outputDir}/${helpDir}">
       <arg line="html" />
   <target name="makefulldist" depends="makedist">
     <copy todir="${packageDir}">
       <fileset dir="${resourceDir}/images">
-        <include name="${WebStartImage}"/>
+        <include name="${WebStartImage}" />
       </fileset>
     </copy>
 
       </fileset>
     </jar>
 
-    <mkdir dir="${packageDir}/JNLP-INF"/>
+    <mkdir dir="${packageDir}/JNLP-INF" />
     <antcall target="writejnlpf">
-      <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP"/>
+      <param name="jnlpFile" value="${packageDir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP" />
       <param name="inih" value="*" />
-      <param name="maxh" value="*"/>
+      <param name="maxh" value="*" />
     </antcall>
 
     <jar destfile="${packageDir}/jalview_jnlp_vm.jar" index="true">
     </jar>
 
     <antcall target="writejnlpf">
-      <param name="jnlpFile" value="${packageDir}/jalview.jnlp"/>
+      <param name="jnlpFile" value="${packageDir}/jalview.jnlp" />
       <param name="inih" value="10M" />
-      <param name="maxh" value="256M"/>
+      <param name="maxh" value="256M" />
     </antcall>
 
     <antcall target="writejnlpf">
-      <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp"/>
+      <param name="jnlpFile" value="${packageDir}/jalview_1G.jnlp" />
       <param name="inih" value="128M" />
-      <param name="maxh" value="512M"/>
+      <param name="maxh" value="512M" />
     </antcall>
 
     <antcall target="writejnlpf">
-      <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp"/>
+      <param name="jnlpFile" value="${packageDir}/jalview_2G.jnlp" />
       <param name="inih" value="256M" />
-      <param name="maxh" value="1024M"/>
+      <param name="maxh" value="1024M" />
     </antcall>
 
     <!-- finally, need to postprocess to add in associations at end of 'information' element 
             <include name="*.jar" />
             <include name="*_*.jar" />
             <exclude name="jalview.jar" />
-               <exclude name="*jnilib.jar"/>
+            <exclude name="*jnilib.jar" />
           </fileset>
-       </resources>
+        </resources>
         <resources os="Mac OS X">
           <property name="jalview.version" value="${JALVIEW_VERSION}" />
-               <fileset dir="${packageDir}">
-                       <include name="*quaqua*.jnilib.jar"/>
-               </fileset>
+          <fileset dir="${packageDir}">
+            <include name="*quaqua*.jnilib.jar" />
+          </fileset>
         </resources>
-       
+
         <application_desc main_class="jalview.bin.Jalview">
         </application_desc>
         <security>
       </jnlp>
     </presetdef>
 
-    <jnlpf toFile="${jnlpFile}"/>
+    <jnlpf toFile="${jnlpFile}" />
 
   </target>
 
   <target name="-dofakejnlpfileassoc" depends="-generatejnlpf" if="nojnlpfileassocs">
-    <echo message="Not adding JNLP File Associations"/>
+    <echo message="Not adding JNLP File Associations" />
   </target>
 
   <target name="-dojnlpfileassoc" depends="-generatejnlpf" unless="nojnlpfileassocs">
         <association mime-type="application-x/ext-file" extensions="jvp"/>
       </information>]]></replacevalue>
   </replace>
-  <echo message="Added file associations to JNLP file"/>
+  <echo message="Added file associations to JNLP file" />
 </target>
 <target name="writejnlpf" depends="-dojnlpfileassoc,-dofakejnlpfileassoc">
 </target>
   <!-- clean dir if it already existed -->
   <delete>
     <fileset dir="${packageDir}">
-      <include name="*.jar"/>
+      <include name="*.jar" />
     </fileset>
   </delete>
   <jar destfile="${packageDir}/${outputJar}" index="true">
 
 
 <!-- Compile, package and obfuscate Jalview Applet -->
-<target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation"/>
+<target name="makeApplet" depends="obfuscate" description="assemble the final jalviewLite applet jar with or without obfuscation" />
 
 <target name="compileApplet" depends="init,clean">
   <mkdir dir="${outputDir}" />
-  <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" 
-                       classpathref="jalviewlite.deps" includes="jalview/appletgui/**"
-                       excludes="ext/**,gui/**,jbgui/**,MCview/**,org/**,vamsas/**,jalview/ext/rbvi/**,jalview/ext/paradise/**" />
+  <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="jalviewlite.deps" includes="jalview/appletgui/**" excludes="ext/**,gui/**,jbgui/**,MCview/**,org/**,vamsas/**,jalview/ext/rbvi/**,jalview/ext/paradise/**" />
 </target>
 
 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
   <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
   <copy todir="${outputDir}/lang">
     <fileset dir="${resourceDir}/lang">
-      <include name="**.*"/>
+      <include name="**.*" />
     </fileset>
   </copy>
   <jar destfile="in.jar" index="true">
     <injar file="in.jar" />
     <outjar file="${jalviewLiteJar}" />
     <libraryjar refid="obfuscateDeps.path" />
-    <dontwarn/>
+    <dontwarn />
     <keep access="public" type="class" name="jalview.bin.JalviewLite">
       <field access="public" />
       <method access="public" />
       <include name="jalview-jalopy.xml" />
       <include name="JalviewApplet.jpx" />
       <include name="JalviewX.jpx" />
-      <include name="nbbuild.xml"/>
-      <include name="nbproject/genfiles.properties"/>
-      <include name="nbproject/project.properties"/>
-      <include name="nbproject/project.xml"/>
+      <include name="nbbuild.xml" />
+      <include name="nbproject/genfiles.properties" />
+      <include name="nbproject/project.properties" />
+      <include name="nbproject/project.xml" />
       <include name="${sourceDir}/*.java" />
       <include name="${sourceDir}/**/*.java" />
       <include name="${sourceDir}/**/*.cdr" />
 <target name="pubapplet" description="installs the jalviewLite applet and dependent jars into an applet examples directory built under ${outputDir}" depends="makeApplet">
   <copy todir="${packageDir}/examples">
     <fileset dir="examples">
-      <include name="**/*"/>
-      <include name="javascript/*"/>
-      <include name="jmol/*"/>
+      <include name="**/*" />
+      <include name="javascript/*" />
+      <include name="jmol/*" />
     </fileset>
     <fileset dir=".">
       <include name="${jalviewLiteJar}" />
     </fileset>
     <fileset dir="appletlib">
-      <include name="**/*"/>
+      <include name="**/*" />
     </fileset>
   </copy>
-  <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}"/>
-  <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}"/>
-  <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}"/>
+  <jar update="true" index="true" jarfile="${packageDir}/examples/${jalviewLiteJar}" />
+  <jar update="true" index="true" jarfile="${packageDir}/examples/${javaJson}" />
+  <jar update="true" index="true" jarfile="${packageDir}/examples/${jsonSimple}" />
   <jar update="true" index="true" jarfile="${packageDir}/examples/${jmolJar}">
     <manifest>
-      <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)"/>
+      <attribute name="Application-Name" value="Jmol (bundled with JalviewLite)" />
       <!--          <attribute name="Permissions" value="sandbox" /> -->
       <!--<attribute name="Trusted-Lib" value="true" /> -->
-      <attribute name="Codebase" value="${applet.codebase}"/>
-      <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}"/>
+      <attribute name="Codebase" value="${applet.codebase}" />
+      <attribute name="Caller-Allowable-Codebase" value="${applet.caller-codebase}" />
     </manifest>
   </jar>
   <signjar sigalg="SHA1WithRSA" storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
   </presetdef>
   <!-- create differently privileged artefacts -->
   <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/u_${jalviewLiteJar}" />
-  <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true"/>
-  <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true"/>
-  <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true"/>
+  <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
+  <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/u_${javaJson}" overwrite="true" />
+  <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/u_${jsonSimple}" overwrite="true" />
   <copy file="${packageDir}/examples/${jalviewLiteJar}" tofile="${packageDir}/examples/ap_${jalviewLiteJar}" />
-  <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}"/>
-  <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}"/>
-  <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}"/>
+  <copy file="${packageDir}/examples/${jmolJar}" tofile="${packageDir}/examples/ap_${jmolJar}" />
+  <copy file="${packageDir}/examples/${javaJson}" tofile="${packageDir}/examples/ap_${javaJson}" />
+  <copy file="${packageDir}/examples/${jsonSimple}" tofile="${packageDir}/examples/ap_${jsonSimple}" />
   <ap_applet.jar jarfile="${packageDir}/examples/ap_${jalviewLiteJar}" />
   <ap_applet.jar jarfile="${packageDir}/examples/ap_${jmolJar}" />
   <ap_applet.jar jarfile="${packageDir}/examples/ap_${javaJson}" />
   <signjar storepass="${jalview.keystore.pass}" keypass="${jalview.key.pass}" keystore="${jalview.keystore}" alias="${jalview.key}" lazy="false" verbose="false">
 
     <fileset dir="${packageDir}/examples">
-      <exclude name="u_*.jar"/>
+      <exclude name="u_*.jar" />
       <include name="${jalviewLiteJar}" />
       <include name="${jmolJar}" />
       <include name="${javaJson}" />
   </signjar>
   <!-- bizarre bug causes JmolApplet to always get signed, even if excluded from above. so copy explicitly -->
   <copy file="appletlib/${jmolJar}" tofile="${packageDir}/examples/u_${jmolJar}" overwrite="true" />
-       <!-- finally, replace any launchApp servlet tags with a version specification -->
-       <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}&quot;">
-               <replacetoken><![CDATA[http://www.jalview.org/services/launchApp"]]></replacetoken>
-               <fileset dir="${packageDir}/examples">
-                       <include name="**/*.html"/>
-               </fileset>
-       </replace>
-       <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
-               <replacetoken><![CDATA[http://www.jalview.org/services/launchApp']]></replacetoken>
-               <fileset dir="${packageDir}/examples">
-                       <include name="**/*.html"/>
-               </fileset>
-       </replace>
+  <!-- finally, replace any launchApp servlet tags with a version specification -->
+  <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}&quot;">
+    <replacetoken>
+      <![CDATA[http://www.jalview.org/services/launchApp"]]>
+    </replacetoken>
+    <fileset dir="${packageDir}/examples">
+      <include name="**/*.html" />
+    </fileset>
+  </replace>
+  <replace value="http://www.jalview.org/services/launchApp?version=${JALVIEW_VERSION}'">
+    <replacetoken>
+      <![CDATA[http://www.jalview.org/services/launchApp']]>
+    </replacetoken>
+    <fileset dir="${packageDir}/examples">
+      <include name="**/*.html" />
+    </fileset>
+  </replace>
 
 </target>
 <target name="sourcedoc" description="Create jalview source documentation pages" depends="init">
index 8969b9d..c4d63ff 100644 (file)
@@ -24,7 +24,7 @@
 <h1> Unit testing in Jalview </h1>
 
 <p>
-In June 2015, the Jalview team adopted <a href=http://testng.org/doc/index.html>TestNG</a> as the favourite unit testing framework. Consequently all existing JUnit tests were ported to TestNG.
+In June 2015, the Jalview team adopted <a href=http://testng.org/doc/index.html>TestNG</a> for handling unit tests, and all existing JUnit tests were ported to TestNG.
 
 
 <h2>Test Groups</h2>
@@ -89,12 +89,11 @@ The TestNG tests for Jalview can be executed in any of the following ways:
        A more detailed guide for installing and executing TestNG in eclipse is available at <a href=http://testng.org/doc/eclipse.html>testng.org/doc/eclipse.html</a> <br>&nbsp;
   </li>
   <li><b>From Ant:</b> 
-        </br> To execute Jalview unit test from ant please take the following steps:
+        </br>The ant task 'testng' will run Jalview's tests. You should:
        <ul>
             <li>Ensure that you have ant installed</li>
             <li>Ensure that your test classes are error free and properly annotated</li>
-            <li>Ensure that the test class or group is available in the TestNG config file. For Jalview this is located in jalview/utils/jalview_testng.xml</li>
-           <li>Add a TestNG run target to your main ant build file, and execute the target.</li>
+            <li>Specify the desired group of tests by passing a comma separated list of one or more groups via -Dtestng-groups=""</li>
         </ul> 
         A more detailed guide for executing TestNG from ant is available at <a href=http://testng.org/doc/ant.html>http://testng.org/doc/ant.html</a>
   </li>
diff --git a/utils/ant-contrib-1.0b3.jar b/utils/ant-contrib-1.0b3.jar
new file mode 100644 (file)
index 0000000..0625376
Binary files /dev/null and b/utils/ant-contrib-1.0b3.jar differ
diff --git a/utils/i18nAnt.xml b/utils/i18nAnt.xml
new file mode 100755 (executable)
index 0000000..eaabc47
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<!--
+  Ant utilities to help with internationalisation of Jalview.
+  Require the additional antcontrib targets (jar file).
+-->
+<project name="jalviewLang" default="checkLang" basedir="..">
+
+<taskdef resource="net/sf/antcontrib/antcontrib.properties">
+  <classpath>
+    <pathelement location="${basedir}/utils/ant-contrib-0.3.jar"/>
+  </classpath>
+</taskdef>
+<taskdef resource="net/sf/antcontrib/antlib.xml"/>
+<target name="checkLang" description="Reports missing entries in language bundles compared to Message.properties">
+       <!-- adapted from http://stackoverflow.com/questions/14381660/ant-task-to-compare-two-properties-files -->
+       <!-- reduce logging level so 'reportMissingProperty' does not clutter up the output -->
+       <script language="javascript">
+        var logger = project.getBuildListeners( ).firstElement( );
+        logger.setMessageOutputLevel( 1 );
+    </script>
+       <foreach target="compareProperties" param="file2">
+               <path>
+                       <fileset dir="${basedir}/resources/lang">
+                               <exclude name="Messages.properties" />
+                       </fileset>
+               </path>
+       </foreach>
+</target>
+
+<target name="compareProperties" description="reports missing entries in one message bundle">
+    <loadproperties srcFile="resources/lang/Messages.properties" prefix="prefixfile1"/>
+    <loadproperties srcFile="${file2}" prefix="prefixfile2"/>
+
+    <propertyselector property="file1.list" delimiter="," match="prefixfile1\.(.+)" select="\1"/>
+    <propertyselector property="file2.list" delimiter="," match="prefixfile2\.(.+)" select="\1"/>
+       
+    <for list="${file1.list}" param="file1.property">
+        <sequential>
+            <if>
+                <not>
+                    <matches pattern=",@{file1.property}," string=",${file2.list}," />
+                </not>
+                <then>
+                    <if>
+                        <not>
+                            <isset property="some_missing"/>
+                        </not>
+                           <then>
+                               <echo message=" "/>
+                               <echo>**** Missing in ${file2}: ****</echo>
+                           </then>
+                    </if>
+                    <property name="some_missing" value="true"/>
+                       <antcall target="reportMissingProperty">
+                               <param name="textLabel" value="@{file1.property}"/>
+                               <param name="prefixedPropertyName" value="prefixfile1.@{file1.property}" />
+                       </antcall>
+                </then>
+            </if>
+        </sequential>
+    </for>
+</target>
+
+<target name="reportMissingProperty" description="double dereference 'prefixedPropertyName' and report missing language property">
+       <propertycopy name="textValue" from="${prefixedPropertyName}"/>
+       <!-- output the property name (message label) and value (English text) -->
+    <echo message="${textLabel}=${textValue}"/>
+</target>
+
+</project>
diff --git a/utils/jalview_testng.xml b/utils/jalview_testng.xml
deleted file mode 100644 (file)
index ba9e660..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
--->
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Suite" parallel="none">
-  <test verbose="2" name="Test">
-    <classes>
-      <class name="jalview.gui.AlignViewportTest"/>
-      <class name="jalview.util.ShiftListTest"/>
-      <class name="jalview.util.ColorUtilsTest"/>
-      <class name="jalview.gui.PDBSearchPanelTest"/>
-      <class name="MCview.PDBfileTest"/>
-      <class name="jalview.io.BioJsHTMLOutputTest"/>
-      <class name="jalview.io.JSONFileTest"/>
-      <class name="jalview.ext.jmol.PDBFileWithJmolTest"/>
-      <class name="jalview.ws.jabaws.RNAStructExportImport"/>
-      <class name="jalview.ext.paradise.TestAnnotate3D"/>
-      <class name="MCview.PDBChainTest"/>
-      <class name="jalview.io.StockholmFileTest"/>
-      <class name="jalview.schemes.ScoreMatrixPrinter"/>
-      <class name="jalview.datamodel.SearchResultsTest"/>
-      <class name="jalview.ws.seqfetcher.DasSequenceFetcher"/>
-      <class name="jalview.util.DBRefUtilsTest"/>
-      <class name="jalview.analysis.CrossRefTest"/>
-      <class name="jalview.ws.jabaws.MinJabawsClientTests"/>
-      <class name="jalview.datamodel.AlignedCodonTest"/>
-      <class name="MCview.AtomTest"/>
-      <class name="jalview.gui.PopupMenuTest"/>
-      <class name="jalview.viewmodel.styles.ViewStyleTest"/>
-      <class name="jalview.io.AnnotationFileIOTest"/>
-      <class name="jalview.ws.jws2.ParameterUtilsTest"/>
-      <class name="jalview.io.RNAMLfileTest"/>
-      <class name="jalview.analysis.AlignmentUtilsTests"/>
-      <class name="jalview.gui.SequenceRendererTest"/>
-      <class name="jalview.bin.CommandLineOperations"/>
-      <class name="jalview.gui.PaintRefresherTest"/>
-      <class name="jalview.ws.seqfetcher.DbRefFetcherTest"/>
-      <class name="jalview.datamodel.AlignmentAnnotationTests"/>
-      <class name="jalview.schemes.ResiduePropertiesTest"/>
-      <class name="jalview.ext.rbvi.chimera.ChimeraCommandsTest"/>
-      <class name="MCview.ResidueTest"/>
-      <class name="jalview.io.PhylipFileTests"/>
-      <class name="jalview.util.MappingUtilsTest"/>
-      <class name="jalview.ws.jabaws.DisorderAnnotExportImport"/>
-      <class name="jalview.analysis.GroupingTest"/>
-      <class name="jalview.analysis.AnnotationSorterTest"/>
-      <class name="jalview.io.FileIOTester"/>
-      <class name="jalview.util.MapListTest"/>
-      <class name="jalview.datamodel.ColumnSelectionTest"/>
-      <class name="jalview.ext.rbvi.chimera.ChimeraConnect"/>
-      <class name="jalview.gui.ProgressBarTest"/>
-      <class name="jalview.analysis.AlignmentAnnotationUtilsTest"/>
-      <class name="jalview.structure.StructureSelectionManagerTest"/>
-      <class name="jalview.io.TCoffeeScoreFileTest"/>
-      <class name="jalview.analysis.AAFrequencyTest"/>
-      <class name="jalview.ws.dbsources.PDBRestClientTest"/>
-      <class name="jalview.analysis.DnaTest"/>
-      <class name="jalview.util.StringUtilsTest"/>
-      <class name="jalview.structures.models.AAStructureBindingModelTest"/>
-      <class name="jalview.gui.JvSwingUtilsTest"/>
-      <class name="jalview.analysis.CodingUtilsTest"/>
-      <class name="jalview.io.AnnotatedPDBFileInputTest"/>
-      <class name="jalview.ws.rest.ShmmrRSBSService"/>
-      <class name="jalview.io.NewickFileTests"/>
-      <class name="jalview.analysis.ParsePropertiesTest"/>
-      <class name="MCview.BondTest"/>
-      <class name="jalview.commands.EditCommandTest"/>
-      <class name="jalview.ext.rbvi.chimera.JalviewChimeraView"/>
-      <class name="jalview.ws.jabaws.JpredJabaStructExportImport"/>
-      <class name="jalview.gui.HelpTest"/>
-      <class name="jalview.datamodel.AlignedCodonIteratorTest"/>
-      <class name="jalview.datamodel.xdb.embl.EmblFileTest"/>
-      <class name="jalview.util.ComparisonTest"/>
-      <class name="jalview.util.QuickSortTest"/>
-      <class name="jalview.ws.PDBSequenceFetcherTest"/>
-      <class name="jalview.analysis.scoremodels.FeatureScoreModelTest"/>
-      <class name="jalview.io.Jalview2xmlTests"/>
-      <class name="jalview.ws.rest.RestClientTest"/>
-      <class name="jalview.datamodel.AlignedCodonFrameTest"/>
-      <class name="jalview.datamodel.MappingTest"/>
-      <class name="jalview.datamodel.AlignmentTest"/>
-      <class name="jalview.ws.dbsources.UniprotTest"/>
-      <class name="jalview.gui.AnnotationChooserTest"/>
-      <class name="jalview.structure.Mapping"/>
-      <class name="jalview.datamodel.SequenceTest"/>
-      <class name="jalview.datamodel.PDBEntryTest"/>
-      <class name="jalview.gui.StructureChooserTest"/>
-      <class name="jalview.schemes.DnaCodonTests"/>
-      <class name="com.stevesoft.pat.RegexWriterTest"/>
-      <class name="jalview.datamodel.DBRefEntryTest"/>
-      <class name="jalview.gui.FontChooserTest"/>
-      <class name="jalview.analysis.TestAlignSeq"/>
-      <class name="jalview.datamodel.SeqCigarTest"/>
-      <class name="jalview.gui.JAL1353bugdemo"/>
-      <class name="jalview.datamodel.AlignmentViewTest"/>
-    </classes>
-  </test> <!-- Test -->
-</suite> <!-- Suite -->