nashorn/make/build.xml
changeset 22367 8c17b1979d29
parent 22366 1db7c8634626
parent 21690 ffbb4611d1f4
child 22371 e6b607104dc6
--- a/nashorn/make/build.xml	Mon Nov 25 18:40:02 2013 +0530
+++ b/nashorn/make/build.xml	Mon Nov 25 11:13:08 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">
@@ -357,6 +367,38 @@
       </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"/>
+    
+    <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
+		<not>
+            <os family="mac"/>
+        </not>
+	</condition>
+    
+    <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>
+      <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
+      <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"/>