NIHVIVO-239 Create a build script for the testrunner, and make it possible to run tests on Vitro.
This commit is contained in:
parent
ad1f9e3b94
commit
32fe55f854
3 changed files with 163 additions and 0 deletions
126
utilities/testrunner/build.xml
Normal file
126
utilities/testrunner/build.xml
Normal file
|
@ -0,0 +1,126 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<!-- ======================================================================
|
||||
Build script for the Selenium test runner.
|
||||
====================================================================== -->
|
||||
|
||||
<project name="acceptanceTests" default="describe" basedir=".">
|
||||
|
||||
<property name="source.dir" location="${basedir}/src" />
|
||||
<property name="lib.dir" location="${basedir}/lib" />
|
||||
<property name="test.dir" location="${basedir}/test" />
|
||||
<property name="build.dir" value="${basedir}/.build" />
|
||||
|
||||
<!-- =================================
|
||||
target: describe
|
||||
================================= -->
|
||||
<target name="describe" description="--> Describe the targets (this is the default).">
|
||||
<echo>
|
||||
all - Runs "clean", then "run".
|
||||
clean - Delete all artifacts so the next build will be from scratch.
|
||||
compile - Compile the Java source files.
|
||||
test - Compile and run the JUnit tests.
|
||||
run - Run the tester.
|
||||
</echo>
|
||||
</target>
|
||||
|
||||
|
||||
<!-- =================================
|
||||
target: all
|
||||
================================= -->
|
||||
<target name="all"
|
||||
depends="clean, run"
|
||||
description="--> Do a clean build and execute the selenium runner.">
|
||||
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: clean
|
||||
================================= -->
|
||||
<target name="clean" description="--> Remove any artifacts from previous builds.">
|
||||
<delete dir="${build.dir}" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: prepare
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="prepare">
|
||||
<mkdir dir="${build.dir}" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: compile
|
||||
================================= -->
|
||||
<target name="compile" depends="prepare" description="--> Compile the selenium runner.">
|
||||
<javac srcdir="${source.dir}"
|
||||
destdir="${build.dir}"
|
||||
debug="true"
|
||||
deprecation="true"
|
||||
optimize="true"
|
||||
source="1.6">
|
||||
</javac>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: test
|
||||
================================= -->
|
||||
<target name="test"
|
||||
depends="compile"
|
||||
description="--> Run unit tests against the selenium runner code.">
|
||||
<javac srcdir="${test.dir}"
|
||||
destdir="${build.dir}"
|
||||
debug="true"
|
||||
deprecation="true"
|
||||
optimize="false"
|
||||
source="1.6">
|
||||
<classpath>
|
||||
<pathelement location="${build.dir}" />
|
||||
<pathelement location="${lib.dir}/junit-4.8.1.jar" />
|
||||
</classpath>
|
||||
</javac>
|
||||
|
||||
<junit printsummary="no" haltonfailure="yes">
|
||||
<classpath>
|
||||
<pathelement location="${build.dir}" />
|
||||
<pathelement location="${lib.dir}/junit-4.8.1.jar" />
|
||||
</classpath>
|
||||
|
||||
<formatter type="brief" />
|
||||
|
||||
<batchtest fork="yes" todir="${build.dir}">
|
||||
<fileset dir="test">
|
||||
<include name="**/*Test*.java" />
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: run
|
||||
================================= -->
|
||||
<target name="run" depends="test" description="--> Execute the selenium runner.">
|
||||
<property name="acceptance.dir" location="${basedir}" />
|
||||
|
||||
<property name="acceptance.properties.file"
|
||||
location="${acceptance.dir}/acceptance_tests.properties" />
|
||||
|
||||
<condition property="acceptance.interactive.arg" value="interactive" else="">
|
||||
<not>
|
||||
<istrue value="${acceptance.batch}" />
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<java classname="edu.cornell.mannlib.vitro.utilities.testrunner.SeleniumRunner"
|
||||
fork="yes"
|
||||
dir="${acceptance.dir}"
|
||||
failonerror="true">
|
||||
<classpath location="${build.dir}" />
|
||||
<arg file="${acceptance.properties.file}" />
|
||||
<arg value="${acceptance.interactive.arg}" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
</project>
|
37
utilities/testrunner/example.acceptance_tests.properties
Normal file
37
utilities/testrunner/example.acceptance_tests.properties
Normal file
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# These properties tell how to set up Selenium to run a test suite.
|
||||
#
|
||||
website_url = http://localhost:8080/vivo/
|
||||
suite_parent_directories = suites
|
||||
output_directory = output
|
||||
user_extensions_path = selenium/user-extensions.js
|
||||
firefox_profile_template_path =
|
||||
suite_timeout_limit = 240
|
||||
selenium_jar_path = selenium/selenium-server.jar
|
||||
|
||||
#
|
||||
# These properties are needed to cleanse the data model between test suites.
|
||||
#
|
||||
# -- Windows commands for Tomcat - require startup.bat and shutdown.bat, which may not be part of the installation.
|
||||
#tomcat_stop_command = "C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\shutdown.bat"
|
||||
#tomcat_start_command = "C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\startup.bat"
|
||||
#
|
||||
# -- Linux commands for Tomcat
|
||||
#tomcat_stop_command = /usr/local/tomcat/bin/shutdown.sh
|
||||
#tomcat_start_command = /usr/local/tomcat/bin/startup.bat
|
||||
|
||||
tomcat_stop_command = "C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\shutdown.bat"
|
||||
tomcat_start_command = "C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\startup.bat"
|
||||
tomcat_stop_delay = 10
|
||||
tomcat_start_delay = 30
|
||||
mysql_username = vivoUser
|
||||
mysql_password = vivoPass
|
||||
mysql_dumpfile = /eclipseVitroWorkspace/vivo/utilities/acceptance-tests/test-model/testmodeldump.sql
|
||||
mysql_db_name = vivo
|
||||
upload_directory = /Vivoweb_Stuff/test_deploy/uploads
|
||||
|
||||
#
|
||||
# These properties control the output formatting of the tests.
|
||||
#
|
||||
ignored_tests_file = /eclipseVitroWorkspace/vivo/utilities/acceptance-tests/suites/ignored_tests.txt
|
||||
summary_css_file = /eclipseVitroWorkspace/vivo/utilities/acceptance-tests/script/output_summary.css
|
BIN
utilities/testrunner/lib/junit-4.8.1.jar
Normal file
BIN
utilities/testrunner/lib/junit-4.8.1.jar
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue