1.1 --- a/make/build.xml Fri Feb 12 19:11:54 2016 +0000 1.2 +++ b/make/build.xml Mon Feb 15 14:36:18 2016 +0100 1.3 @@ -49,9 +49,17 @@ 1.4 <condition property="git.executable" value="/usr/local/bin/git" else="git"> 1.5 <available file="/usr/local/bin/git"/> 1.6 </condition> 1.7 - <!-- check if testng.jar is avaiable --> 1.8 - <available property="testng.available" file="${file.reference.testng.jar}"/> 1.9 - <!-- check if Jemmy ang testng.jar are avaiable --> 1.10 + <!-- check if TestNG and dependencies are available, and download them if they aren't --> 1.11 + <antcall target="get-testng"/> 1.12 + <condition property="testng.available" value="true"> 1.13 + <and> 1.14 + <available file="${file.reference.testng.jar}"/> 1.15 + <available file="${file.reference.jcommander.jar}"/> 1.16 + <available file="${file.reference.bsh.jar}"/> 1.17 + <available file="${file.reference.snakeyaml.jar}"/> 1.18 + </and> 1.19 + </condition> 1.20 + <!-- check if Jemmy ang TestNG are avaiable --> 1.21 <condition property="jemmy.jfx.testng.available" value="true"> 1.22 <and> 1.23 <available file="${file.reference.jemmyfx.jar}"/> 1.24 @@ -275,7 +283,7 @@ 1.25 <target name="compile-test" depends="compile, run-nasgen" if="testng.available"> 1.26 <!-- testng task --> 1.27 <taskdef name="testng" classname="org.testng.TestNGAntTask" 1.28 - classpath="${file.reference.testng.jar}"/> 1.29 + classpath="${testng.ant.classpath}"/> 1.30 1.31 <javac srcdir="${test.src.dir}" 1.32 destdir="${build.test.classes.dir}" 1.33 @@ -331,6 +339,15 @@ 1.34 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" { 1.35 permission java.security.AllPermission; 1.36 }; 1.37 +grant codeBase "file:/${basedir}/${file.reference.jcommander.jar}" { 1.38 + permission java.security.AllPermission; 1.39 +}; 1.40 +grant codeBase "file:/${basedir}/${file.reference.bsh.jar}" { 1.41 + permission java.security.AllPermission; 1.42 +}; 1.43 +grant codeBase "file:/${basedir}/${file.reference.snakeyaml.jar}" { 1.44 + permission java.security.AllPermission; 1.45 +}; 1.46 //// in case of absolute path: 1.47 grant codeBase "file:/${nashorn.internal.tests.jar}" { 1.48 permission java.security.AllPermission; 1.49 @@ -339,6 +356,16 @@ 1.50 grant codeBase "file:/${file.reference.testng.jar}" { 1.51 permission java.security.AllPermission; 1.52 }; 1.53 +grant codeBase "file:/${file.reference.jcommander.jar}" { 1.54 + permission java.security.AllPermission; 1.55 +}; 1.56 +grant codeBase "file:/${file.reference.bsh.jar}" { 1.57 + permission java.security.AllPermission; 1.58 +}; 1.59 +grant codeBase "file:/${file.reference.snakeyaml.jar}" { 1.60 + permission java.security.AllPermission; 1.61 +}; 1.62 + 1.63 1.64 grant codeBase "file:/${basedir}/test/script/trusted/*" { 1.65 permission java.security.AllPermission; 1.66 @@ -408,7 +435,7 @@ 1.67 </target> 1.68 1.69 <target name="check-testng" unless="testng.available"> 1.70 - <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under ${test.lib} directory."/> 1.71 + <echo message="WARNING: TestNG not available, will not run tests. Please copy TestNG and dependency JARs to the ${test.lib} directory."/> 1.72 </target> 1.73 1.74 <!-- only to be invoked as dependency of "test" target --> 1.75 @@ -480,7 +507,7 @@ 1.76 </testng> 1.77 </target> 1.78 1.79 - <target name="test" depends="get-testng, javadocnh, test-pessimistic, test-optimistic"/> 1.80 + <target name="test" depends="prepare, javadocnh, test-pessimistic, test-optimistic"/> 1.81 1.82 <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available"> 1.83 <echo message="Running test suite in OPTIMISTIC mode..."/> 1.84 @@ -507,7 +534,7 @@ 1.85 </target> 1.86 1.87 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available"> 1.88 - <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/> 1.89 + <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy TestNG and dependency JARs, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar to the test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/> 1.90 </target> 1.91 1.92 <target name="testjfx" depends="jar, get-testng, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available"> 1.93 @@ -742,15 +769,13 @@ 1.94 <target name="perf" depends="externals, update-externals, sunspider, octane"/> 1.95 1.96 <!-- download and install testng.jar --> 1.97 - <target name="get-testng" depends="prepare" unless="testng.available"> 1.98 - <get src="http://testng.org/testng-6.8.zip" dest="${test.lib}" skipexisting="true" ignoreerrors="true"/> 1.99 - <unzip src="${test.lib}${file.separator}testng-6.8.zip" dest="${test.lib}"> 1.100 - <patternset> 1.101 - <include name="testng-6.8/testng-6.8.jar"/> 1.102 - </patternset> 1.103 - </unzip> 1.104 - <move file="${test.lib}${file.separator}testng-6.8${file.separator}testng-6.8.jar" tofile="${test.lib}${file.separator}testng.jar"/> 1.105 - <delete dir="${test.lib}${file.separator}testng-6.8"/> 1.106 + <target name="get-testng"> 1.107 + <get dest="${test.lib}" skipexisting="true"> 1.108 + <url url="http://central.maven.org/maven2/org/testng/testng/6.8/testng-6.8.jar"/> 1.109 + <url url="http://central.maven.org/maven2/com/beust/jcommander/1.27/jcommander-1.27.jar"/> 1.110 + <url url="http://central.maven.org/maven2/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/> 1.111 + <url url="http://central.maven.org/maven2/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar"/> 1.112 + </get> 1.113 </target> 1.114 1.115 <!-- run all tests -->