/hg/icedtea-web: added support for testng
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Mon Apr 11 06:40:25 PDT 2011
changeset 1cce62b89f07 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=1cce62b89f07
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Apr 11 15:36:10 2011 +0200
added support for testng
diffstat:
AUTHORS | 1 +
ChangeLog | 4 +
Makefile.am | 72 +++++++++++++++++++++++-
acinclude.m4 | 7 ++
configure.ac | 6 ++
tests/netx/unit/net/sourceforge/jnlp/basic.jnlp | 11 +--
6 files changed, 92 insertions(+), 9 deletions(-)
diffs (203 lines):
diff -r 4f195bca0dc8 -r 1cce62b89f07 AUTHORS
--- a/AUTHORS Mon Apr 11 15:08:01 2011 +0200
+++ b/AUTHORS Mon Apr 11 15:36:10 2011 +0200
@@ -13,6 +13,7 @@
Jon A. Maxwell <jmaxwell at users.sourceforge.net>
Andrew Su <asu at redhat.com>
Joshua Sumali <jsumali at redhat.com>
+Jiri Vanek <jvanek at redhat.com>
Mark Wielaard <mark at klomp.org>
Man Lung Wong <mwong at redhat.com>
diff -r 4f195bca0dc8 -r 1cce62b89f07 ChangeLog
--- a/ChangeLog Mon Apr 11 15:08:01 2011 +0200
+++ b/ChangeLog Mon Apr 11 15:36:10 2011 +0200
@@ -1,3 +1,7 @@
+2011-04-11 Jiri Vanek <jvanek at redhat.com>
+
+ * added testng support (2/2)
+
2011-04-11 Jiri Vanek <jvanek at redhat.com>
* removed junit (1/2 from mooving to testNG)
diff -r 4f195bca0dc8 -r 1cce62b89f07 Makefile.am
--- a/Makefile.am Mon Apr 11 15:08:01 2011 +0200
+++ b/Makefile.am Mon Apr 11 15:36:10 2011 +0200
@@ -6,6 +6,12 @@
NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/javaws/about/resources
NETX_EXTRA_DIST_DIR=$(abs_top_builddir)/extra-lib/net/sourceforge/javaws/about/resources
+TESTS_DIR=$(abs_top_builddir)/tests.build
+TESTS_SRCDIR=$(abs_top_srcdir)/tests
+
+NETX_UNIT_TEST_DIR=$(TESTS_DIR)/netx/unit
+NETX_UNIT_TEST_SRCDIR=$(TESTS_SRCDIR)/netx/unit
+
# Build directories
BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0
@@ -80,6 +86,23 @@
endif
endif
+if WITH_RHINO
+ RHINO_TESTS=check-pac-functions
+else
+ RHINO_TESTS=
+endif
+
+UNIT_TESTS=
+if WITH_TESTNG
+if WITH_QDOX
+if WITH_BSH
+if WITH_XSLT
+ UNIT_TESTS+=run-netx-unit-tests
+endif
+endif
+endif
+endif
+
PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION)
EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in extra launcher \
@@ -100,7 +123,7 @@
all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/javaws \
javaws.desktop stamps/docs.stamp launcher.build/itweb-settings itweb-settings.desktop
-check-local: check-pac-functions
+check-local: $(RHINO_TESTS) $(UNIT_TESTS)
clean-local: clean-netx clean-plugin clean-liveconnect clean-extra clean-bootstrap-directory \
clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-tests
@@ -110,7 +133,8 @@
.PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \
clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs \
- clean-tests check-local clean-launchers
+ clean-tests check-local clean-launchers check-pac-functions run-netx-unit-tests clean-netx-tests \
+ clean-netx-unit-tests
install-exec-local:
${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir)
@@ -398,11 +422,53 @@
# check
# ==========================
+clean-tests: clean-netx-tests
+ if [ -e $(TESTS_DIR) ]; then \
+ rmdir $(TESTS_DIR) ; \
+ fi
+
check-pac-functions: stamps/bootstrap-directory.stamp
./jrunscript $(abs_top_srcdir)/tests/netx/pac/pac-funcs-test.js \
$$(readlink -f $(abs_top_srcdir)/netx/net/sourceforge/jnlp/runtime/pac-funcs.js)
--clean-tests:
+netx-unit-tests-source-files.txt:
+ find $(NETX_UNIT_TEST_SRCDIR) -name '*.java' | sort > $@
+
+stamps/netx-unit-tests-compile.stamp: stamps/netx.stamp \
+ netx-unit-tests-source-files.txt
+ mkdir -p $(NETX_UNIT_TEST_DIR)
+ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
+ -d $(NETX_UNIT_TEST_DIR) \
+ -classpath $(TESTNG_JAR):$(NETX_DIR)/lib/classes.jar \
+ @netx-unit-tests-source-files.txt
+ (cd $(NETX_UNIT_TEST_DIR) ; \
+ $(BOOT_DIR)/bin/jar cf netx-tests.jar net)
+ mkdir -p stamps
+ touch $@
+
+stamps/netx-unit-tests-update-jar.stamp: stamps/netx-unit-tests-compile.stamp
+ (cd $(NETX_UNIT_TEST_SRCDIR) ; \
+ $(BOOT_DIR)/bin/jar uf $(NETX_UNIT_TEST_DIR)/netx-tests.jar \
+ net/sourceforge/jnlp/basic.jnlp)
+ mkdir -p stamps
+ touch $@
+
+run-netx-unit-tests: stamps/netx-unit-tests-update-jar.stamp
+ $(BOOT_DIR)/bin/java \
+ -classpath $(NETX_UNIT_TEST_DIR)/netx-tests.jar:$(NETX_DIR)/lib/classes.jar:$(TESTNG_JAR):$(QDOX_JAR):$(BSH_JAR) \
+ org.testng.TestNG -d $(NETX_UNIT_TEST_DIR)/tests-output $(NETX_UNIT_TEST_SRCDIR)/tests.xml || true
+ $(XSLT) $(abs_top_srcdir)/testng-to-jtreg.xslt $(NETX_UNIT_TEST_DIR)/tests-output/testng-results.xml
+
+clean-netx-tests: clean-netx-unit-tests
+ if [ -e $(TESTS_DIR)/netx ]; then \
+ rmdir $(TESTS_DIR)/netx ; \
+ fi
+
+clean-netx-unit-tests:
+ rm -f netx-unit-tests-source-files.txt
+ rm -rf $(NETX_UNIT_TEST_DIR)
+ rm -f stamps/netx-unit-tests-compile.stamp
+ rm -f stamps/netx-unit-tests-update-jar.stamp
# plugin tests
diff -r 4f195bca0dc8 -r 1cce62b89f07 acinclude.m4
--- a/acinclude.m4 Mon Apr 11 15:08:01 2011 +0200
+++ b/acinclude.m4 Mon Apr 11 15:36:10 2011 +0200
@@ -497,6 +497,13 @@
AC_SUBST([$1])
])
+AC_DEFUN_ONCE([IT_FIND_OPTIONAL_PROG],
+[
+ AC_PATH_PROG([$1], [$2])
+ AM_CONDITIONAL(WITH_$1, test x"$$1" != "x")
+ AC_SUBST([$1])
+])
+
AC_DEFUN([IT_SET_ARCH_SETTINGS],
[
case "${host_cpu}" in
diff -r 4f195bca0dc8 -r 1cce62b89f07 configure.ac
--- a/configure.ac Mon Apr 11 15:08:01 2011 +0200
+++ b/configure.ac Mon Apr 11 15:36:10 2011 +0200
@@ -85,6 +85,12 @@
IT_FIND_OPTIONAL_JAR([rhino], RHINO,
[/usr/share/java/js.jar /usr/share/rhino-1.6/lib/js.jar])
+IT_FIND_OPTIONAL_JAR([testng], TESTNG,
+ [/usr/share/java/testng.jar])
+IT_FIND_OPTIONAL_JAR([qdox], QDOX)
+IT_FIND_OPTIONAL_JAR([bsh], BSH)
+
+IT_FIND_OPTIONAL_PROG(XSLT, [xsltproc])
AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript])
AC_CONFIG_FILES([build.properties])
diff -r 4f195bca0dc8 -r 1cce62b89f07 tests/netx/unit/net/sourceforge/jnlp/basic.jnlp
--- a/tests/netx/unit/net/sourceforge/jnlp/basic.jnlp Mon Apr 11 15:08:01 2011 +0200
+++ b/tests/netx/unit/net/sourceforge/jnlp/basic.jnlp Mon Apr 11 15:36:10 2011 +0200
@@ -1,11 +1,11 @@
-<?xml version='1.0' encoding='utf-8'?>
+<?xml version='1.0' encoding='utf-8'?>
<!-- this is a sample jnlp file -->
<jnlp spec='1.0'
codebase='http://localhost/'
href='jnlp.jnlp'>
- <information>
+ <information>
<!-- this is the information section -->
- <title>Large JNLP</title>
+ <title>Large JNLP</title>
<vendor>The IcedTea Project</vendor>
<homepage href='http://homepage/' />
<description kind='one-line'>one-line</description>
@@ -24,7 +24,7 @@
<description>decription of related-content</description>
<icon href='related-content-icon.png' />
</related-content>
- </information>
+ </information>
<security>
<all-permissions/>
</security>
@@ -43,5 +43,4 @@
<argument>arg1</argument>
<argument>arg2</argument>
</application-desc>
-</jnlp>
-
+</jnlp>
More information about the distro-pkg-dev
mailing list