aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorkshefov <none@none>2013-10-21 13:31:03 +0400
committerkshefov <none@none>2013-10-21 13:31:03 +0400
commit9fd64f71e21ec6ea4f381c5cbe1d15454a4553e4 (patch)
tree326fb4ecf1fb389b909a61fafba9a669f2ad736a /make
parent32549b5fdbd20b05766cb64d079e7a4087b4d125 (diff)
downloadnashorn-9fd64f71e21ec6ea4f381c5cbe1d15454a4553e4.tar.gz
8026871: NASHORN TEST: Enable possibility to test Nashorn use of JavaFX canvas.
Reviewed-by: jlaskey, sundar
Diffstat (limited to 'make')
-rw-r--r--make/build.xml35
-rw-r--r--make/project.properties27
2 files changed, 62 insertions, 0 deletions
diff --git a/make/build.xml b/make/build.xml
index 01410947..c90cdd6f 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -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 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
</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"/>
diff --git a/make/project.properties b/make/project.properties
index 2ad619be..33c94780 100644
--- a/make/project.properties
+++ b/make/project.properties
@@ -118,6 +118,7 @@ test.trusted.dir=test/script/trusted
test.external.dir=test/script/external
test262.dir=${test.external.dir}/test262
test262.suite.dir=${test262.dir}/test/suite
+testjfx.dir=${test.script.dir}/jfx
test-sys-prop.test.dir=${test.dir}
test-sys-prop.test.js.roots=${test.basic.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir}
@@ -208,6 +209,32 @@ test262-test-sys-prop.test.js.framework=\
${test262.dir}/test/harness/framework.js \
${test262.dir}/test/harness/sta.js
+# testjfx test root
+testjfx-test-sys-prop.test.js.roots=${testjfx.dir}
+
+# execute testjfx tests in shared nashorn context or not?
+testjfx-test-sys-prop.test.js.shared.context=false
+
+# framework root for our script tests
+testjfx-test-sys-prop.test.js.framework=\
+ -fx \
+ ${test.script.dir}${file.separator}jfx.js
+
+file.reference.jemmyfx.jar=test${file.separator}lib${file.separator}JemmyFX.jar
+file.reference.jemmycore.jar=test${file.separator}lib${file.separator}JemmyCore.jar
+file.reference.jemmyawtinput.jar=test${file.separator}lib${file.separator}JemmyAWTInput.jar
+file.reference.jfxrt.jar=${java.home}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar
+testjfx.run.test.classpath=\
+ ${file.reference.jemmyfx.jar}${path.separator}\
+ ${file.reference.jemmycore.jar}${path.separator}\
+ ${file.reference.jemmyawtinput.jar}${path.separator}\
+ ${file.reference.testng.jar}${path.separator}\
+ ${nashorn.internal.tests.jar}${path.separator}\
+ ${nashorn.api.tests.jar}
+
+# testjfx VM options for script tests with @fork option
+testjfx-test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} -cp ${testjfx.run.test.classpath}
+
run.test.classpath=\
${file.reference.testng.jar}:\
${nashorn.internal.tests.jar}:\