From db8a93364f9e412101f86f1dde6ad9d12cfc6834 Mon Sep 17 00:00:00 2001 From: Michael Haupt Date: Tue, 2 Jun 2015 14:35:03 +0200 Subject: [PATCH] 8080275: transparently download testng.jar for Nashorn testing Instead of asking the user to manually download and install testng.jar, automate the process via "ant externals". Reviewed-by: hannesw, sundar --- nashorn/README | 11 ++++------- nashorn/make/build.xml | 18 +++++++++++++++--- nashorn/make/project.properties | 13 ++++++++----- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/nashorn/README b/nashorn/README index 242d6077b67..9cc6c723213 100644 --- a/nashorn/README +++ b/nashorn/README @@ -72,14 +72,11 @@ after which you can view the generated documentation at dist/javadoc/index.html. - Running tests Nashorn tests are TestNG based. Running tests requires downloading the -TestNG library and placing its jar file into the lib subdirectory: +TestNG library and placing its jar file into the test/lib subdirectory. This is +done automatically when executing the "ant externals" command to get external +test suites (see below). - # download and install TestNG - wget http://testng.org/testng-x.y.z.zip - unzip testng-x.y.z.zip - cp testng-x.y.z/testng-x.y.z.jar test/lib/testng.jar - -After that, you can run the tests using: +Once TestNG is properly installed, you can run the tests using: cd make ant clean test diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml index ea6153f6f7a..f873de3858d 100644 --- a/nashorn/make/build.xml +++ b/nashorn/make/build.xml @@ -1,7 +1,7 @@ @@ -694,7 +694,7 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { - + @@ -735,6 +735,18 @@ grant codeBase "file:/${basedir}/test/script/markdown.js" { + + + + + + + + + + + + diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties index 35e1af9f146..aab32c62a83 100644 --- a/nashorn/make/project.properties +++ b/nashorn/make/project.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -77,8 +77,11 @@ fxshell.jar = ${dist.dir}/nashornfx.jar # configuration for java flight recorder run.test.jvmargs.jfr=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=${build.dir},stackdepth=128 +# test library location +test.lib=${basedir}${file.separator}test${file.separator}lib + # jars refererred -file.reference.testng.jar=test/lib/testng.jar +file.reference.testng.jar=${test.lib}${file.separator}testng.jar # Set testng verbose level # From TestNG docs: "the verbosity level (0 to 10 where 10 is most detailed) @@ -243,9 +246,9 @@ 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.jemmyfx.jar=${test.lib}${file.separator}JemmyFX.jar +file.reference.jemmycore.jar=${test.lib}${file.separator}JemmyCore.jar +file.reference.jemmyawtinput.jar=${test.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}\