nashorn/make/build.xml
changeset 21443 85671274e5fb
parent 20564 f353da961684
child 21690 ffbb4611d1f4
--- a/nashorn/make/build.xml	Mon Oct 21 10:09:19 2013 +0530
+++ b/nashorn/make/build.xml	Mon Oct 21 13:31:03 2013 +0400
@@ -46,6 +46,16 @@
     <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
     <!-- check if testng.jar is avaiable -->
     <available property="testng.available" file="${file.reference.testng.jar}"/>
+    <!-- check if Jemmy ang testng.jar are avaiable -->
+    <condition property="jemmy.jfx.testng.available" value="true">
+      <and> 
+        <available file="${file.reference.jemmyfx.jar}"/>
+        <available file="${file.reference.jemmycore.jar}"/>
+        <available file="${file.reference.jemmyawtinput.jar}"/>
+        <available file="${file.reference.jfxrt.jar}"/>
+        <isset property="testng.available"/>
+      </and>
+    </condition>
 
     <!-- enable/disable make code coverage -->
     <condition property="cc.enabled">
@@ -351,6 +361,31 @@
       </java>
   </target>
 
+  <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
+    <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."/>
+  </target>
+
+  <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
+    <fileset id="test.classes" dir="${build.test.classes.dir}">
+       <include name="**/framework/*Test.class"/>
+    </fileset>
+    
+    <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
+    
+    <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
+       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
+      <propertyset>
+        <propertyref prefix="testjfx-test-sys-prop."/>
+        <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
+      </propertyset>
+      <classpath>
+          <pathelement path="${testjfx.run.test.classpath}"/>
+      </classpath>
+    </testng>
+  </target>
+  
   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>