PageRenderTime 486ms CodeModel.GetById 482ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/tests/Fest/example_plugin_test_build.xml

#
XML | 133 lines | 87 code | 20 blank | 26 comment | 0 complexity | 7a42ff6ad69f91192eca098763d167a0 MD5 | raw file
  1<project name="svn_plugin_tests" default="test" basedir=".">
  2    
  3    <description>
  4    This is an example build file to run unit tests.  This the build file for
  5    the unit tests for the SVN plugin.  It has comments to describe all the
  6    necessary settings for getting unit tests to run.
  7    
  8    The SVNPlugin source directory looks like this:
  9    SVNPlugin
 10    |
 11    +- lib
 12    +- src
 13    +- test
 14       |
 15       -- build.xml (this file)
 16       +- test (holds the source code for the unit tests)
 17       +- test_reports (holds the output from JUnit)
 18       
 19    It is assumed that the plugin is already build and deployed to the standard
 20    ${install.dir} as is typical for plugins.  If the plugin is actually built
 21    to some other directory, you'll need to change the directory for the 
 22    'plugin.jars' file list below.
 23    
 24    There is no assumption made about the location of the test framework itself.
 25    I have it installed in a directory at the same level as jEdit:
 26    
 27    /home/danson/src
 28    |
 29    +- jEdit
 30    +- jEditTestFramework
 31    +- plugins
 32       |
 33       -- build.properties
 34       +- build-support
 35       +- ...
 36       +- SVNPlugin 
 37       
 38    The location of the test framework directory should be set in a property 
 39    file.  A good place to set this property is in the same build.properties
 40    used in general for plugin builds.
 41    
 42    -----
 43    Runs junit tests on the SVNPlugin.  Assumes a normal build of the plugin
 44    has already happened and been deployed to the standard ${install.dir}.  The
 45    test framework assumes the jEdit source is installed.  It will do a clean
 46    build of jEdit and use the resulting build directory as the jEdit settings
 47    directory and the jEdit installation.  Jars required by the plugin are
 48    specified in the plugin.jars filelist and will be copied into the jEdit
 49    build directory in a jars subdirectory.
 50    </description>
 51
 52    <!-- general properties for plugins from the plugins directory, in 
 53    partcular, need the install.dir set to know where to find the plugin
 54    jar files. -->
 55    <property file="../../build.properties"/>
 56    
 57    <!-- location of the test framework, this should be set in the build.properties
 58    file loaded above. -->
 59    <property name="test.framework.home" location="/home/danson/src/jEditTestFramework"/>
 60    
 61    
 62    <!-- html tests report -->
 63    <property name="junit-report.enabled" value="true"/> 
 64
 65    <!-- test source and classes -->
 66    <property name="project.test.src.dir" location="${basedir}"/>
 67    <property name="project.test.classes.dir" location="${basedir}/classes"/>
 68    <mkdir dir="${project.test.classes.dir}"/>
 69
 70    <!-- marker property to indicate to the test framework that plugin jars
 71    need to be copied -->
 72    <property name="copyPluginJars" value=""/>
 73    
 74    <!-- full list of all jar files necessary to let jEdit load and run
 75    the plugin.  All of these files will be copied to the jedit_settings/jar
 76    directory. -->
 77    <filelist id="plugin.jars" dir="${install.dir}">
 78        <file name="jna.jar"/>
 79        <file name="svnkit-cli.jar"/>
 80        <file name="svnkit.jar"/>
 81        <file name="trilead.jar"/>
 82        <file name="SVNPlugin.jar"/>
 83        <file name="JDiffPlugin.jar"/>
 84        <file name="ProjectViewer.jar"/>
 85        <file name="CommonControls.jar"/>
 86        <file name="kappalayout.jar"/>
 87    </filelist>
 88
 89    <!-- include everything needed to let jEdit load the plugin and run the 
 90    unit tests.  This should include all the jars listed in the plugin.jars 
 91    file list defined above. -->
 92    <path id="project.class.path">
 93        <pathelement path="project.test.classes.dir"/>
 94        <path>
 95            <filelist refid="plugin.jars"/>
 96        </path>
 97    </path>
 98
 99    <!-- these are the actual test files to compile.  This is included so it
100    is easy to fine tune which tests are compiled and ran. --> 
101    <selector id="projectFiles">
102        <filename name="**/*.java" />
103    </selector>
104    
105    <!-- this selector holds all test cases.  This is optional. -->
106    <selector id="testcases.all">
107        <or>
108            <filename name="test/**/*Test.java"/>
109        </or>
110    </selector>
111
112    <!-- this selector holds just one test.  This is optional. -->
113    <selector id="testcases.current">
114        <filename name="test/OptionPaneTest.java"/>
115    </selector>
116
117    <!-- this selector controls which tests to run, set the refid to either
118    testcases.current to run just one test or testcases.all to run all tests,
119    or some other selector.  This is NOT optional, if this selector is not
120    defined, no tests will run. -->
121    <selector id="junit.testcases">
122        <or>
123            <selector refid="testcases.current"/>
124        </or>
125    </selector>
126    
127    <!-- actually call the test framework to run the tests.  inheritRefs must
128    be true so that all of the things defined above are known to the test 
129    framework. -->
130    <target name="test">
131        <ant antfile="${test.framework.home}/build.xml" target="test" inheritRefs="true"/>
132    </target>
133</project>