Ignore:
Timestamp:
2014-08-04T02:45:06+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] support for unit tests

Location:
applications/editors/josm/plugins/turnrestrictions
Files:
3 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/.classpath

    r30416 r30550  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="src" path="test/src"/>
     4        <classpathentry kind="src" path="test/unit"/>
    55        <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
    66        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    77        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    8         <classpathentry kind="lib" path="test/config"/>
    98        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
    109        <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
  • applications/editors/josm/plugins/turnrestrictions/build.xml

    r30453 r30550  
    66    <property name="plugin.main.version" value="7128"/>
    77
    8     <property name="test.build.dir" value="test/build"/>
    9     <property name="eclipse.plugin.dir" value="C:\software\eclipse-3.6.1\plugins"/>
     8    <!-- Configure these properties (replace "..." accordingly).
     9         See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
     10    -->
     11    <property name="plugin.author" value="Karl Guggisberg"/>
     12    <property name="plugin.class" value="org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionsPlugin"/>
     13    <property name="plugin.description" value="The turnrestrictions plugin allows to enter maintain information about turn restrictions in the OpenStreetMap database."/>
     14    <property name="plugin.icon" value="images/preferences/turnrestrictions.png"/>
     15    <property name="plugin.link" value="https://josm.openstreetmap.de/wiki/Help/Plugin/TurnRestrictions"/>
    1016
    11     <!--
    12     **********************************************************
    13     ** include targets that all plugins have in common
    14     **********************************************************
    15     -->
     17    <!-- ** include targets that all plugins have in common ** -->
    1618    <import file="../build-common.xml"/>
    17  
    18     <!--
    19     **********************************************************
    20     ** init - initializes the build
    21     **********************************************************
    22     -->
    23     <target name="init">
    24         <mkdir dir="${plugin.build.dir}"/>
    25         <mkdir dir="${test.build.dir}"/>
    26     </target>
    27 
    28     <!--
    29     **********************************************************
    30     ** clean - clean up the build environment
    31     **********************************************************
    32     -->
    33     <target name="clean">
    34         <delete dir="${plugin.build.dir}"/>
    35         <delete dir="${test.build.dir}"/>
    36         <delete file="${plugin.jar}"/>
    37     </target>
    38 
    39     <!--
    40     **********************************************************
    41     ** dist - creates the plugin jar
    42     **********************************************************
    43     -->
    44     <target name="dist" depends="compile,revision">
    45         <echo message="creating ${ant.project.name}.jar ... "/>
    46         <copy todir="${plugin.build.dir}/resources">
    47             <fileset dir="resources"/>
    48         </copy>
    49         <copy todir="${plugin.build.dir}/images">
    50             <fileset dir="images"/>
    51         </copy>
    52         <copy todir="${plugin.build.dir}/data">
    53             <fileset dir="data"/>
    54         </copy>
    55         <copy todir="${plugin.build.dir}">
    56             <fileset dir=".">
    57                 <include name="README"/>
    58                 <include name="LICENSE"/>
    59             </fileset>
    60         </copy>
    61         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    62         <!--
    63         ************************************************
    64         ** configure these properties. Most of them will be copied to the plugins
    65         ** manifest file. Property values will also show up in the list available
    66         ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
    67         **
    68         ************************************************
    69         -->
    70             <manifest>
    71                 <attribute name="Author" value="Karl Guggisberg"/>
    72                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionsPlugin"/>
    73                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    74                 <attribute name="Plugin-Description" value="The turnrestrictions plugin allows to enter maintain information about turn restrictions in the OpenStreetMap database."/>
    75                 <attribute name="Plugin-Icon" value="images/preferences/turnrestrictions.png"/>
    76                 <attribute name="Plugin-Link" value="http://josm.openstreetmap.de/wiki/Help/Plugin/TurnRestrictions"/>
    77                 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    78                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    79             </manifest>
    80         </jar>
    81     </target>
    82 
    83     <!-- ************************************************************************************ -->
    84     <!-- * Targets for compiling and running tests                                            -->
    85     <!-- ************************************************************************************ -->
    86     <path id="groovy.path">
    87         <pathelement location="${eclipse.plugin.dir}/org.codehaus.groovy_1.7.5.xx-20100926-2000-e36-RC1\lib\groovy-all-1.7.5.jar"/>
    88     </path>
    89     <path id="junit.path">
    90         <pathelement location="${eclipse.plugin.dir}/org.junit_4.8.1.v4_8_1_v20100427-1100\junit.jar"/>
    91     </path>
    92     <path id="fest.library.path">
    93         <fileset dir="test/lib">
    94             <include name="fest-*.jar"/>
    95             <include name="jcp-*.jar"/>
    96         </fileset>
    97     </path>
    98     <path id="test.class.path">
    99         <pathelement location="${josm}"/>
    100         <pathelement location="${plugin.build.dir}"/>
    101         <path refid="groovy.path"/>
    102         <path refid="junit.path"/>
    103         <path refid="fest.library.path"/>
    104     </path>
    105     <path id="groovyc.path">
    106         <path refid="junit.path"/>
    107         <path refid="groovy.path"/>
    108         <path refid="fest.library.path"/>
    109         <pathelement location="${josm}"/>
    110         <pathelement location="${test.build.dir}"/>
    111         <pathelement location="${plugin.build.dir}"/>
    112         <!-- if we didn't explicitly put hamcrest on the class path, groovyc would
    113              abort and report it is missing a hamcrest class -->
    114         <pathelement location="test/lib/hamcrest-all-1.2.jar"/>
    115     </path>
    116     <target name="test-clean">
    117         <delete dir="${test.build.dir}"/>
    118         <mkdir dir="${test.build.dir}"/>
    119     </target>
    120     <target name="test-compile" depends="compile,test-clean" description="Compiles the test files">
    121         <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovy.path"/>
    122         <echo message="compiling test infrastructor for ${plugin.jar} ... "/>
    123         <javac srcdir="test/src" classpathref="test.class.path" debug="true" destdir="${test.build.dir}" includes="org/openstreetmap/josm/plugins/turnrestrictions/fixtures/**/*">
    124             <compilerarg value="-Xlint:deprecation"/>
    125             <compilerarg value="-Xlint:unchecked"/>
    126         </javac>
    127         <echo message="compiling groovy test cases for ${plugin.jar} ... "/>
    128         <groovyc srcdir="test/src" destdir="${test.build.dir}" classpathref="groovyc.path">
    129         </groovyc>
    130         <echo message="compiling java test cases for ${plugin.jar} ... "/>
    131         <javac srcdir="test/src" classpathref="test.class.path" debug="true" destdir="${test.build.dir}">
    132             <compilerarg value="-Xlint:deprecation"/>
    133             <compilerarg value="-Xlint:unchecked"/>
    134         </javac>
    135     </target>
    136     <target name="test-run" depends="test-compile" description="Runs the junit tests">
    137         <delete dir="test/output"/>
    138         <mkdir dir="test/output"/>
    139         <junit printsummary="true" failureproperty="junit.failure">
    140             <classpath>
    141                 <path refid="groovyc.path"/>
    142                 <pathelement location="test/config"/>
    143                 <!-- required for test config file -->
    144                 <pathelement location="."/>
    145                 <!-- required to load images from subdir 'images/' -->
    146             </classpath>
    147             <test todir="test/output" name="org.openstreetmap.josm.plugins.turnrestrictions.AllUnitTests">
    148                 <formatter type="xml"/>
    149             </test>
    150         </junit>
    151     </target>
    15219</project>
  • applications/editors/josm/plugins/turnrestrictions/test

    • Property svn:ignore
      •  

        old new  
        11build
         2report
  • applications/editors/josm/plugins/turnrestrictions/test/README

    r23524 r30550  
    33
    44
    5 src/             test sources (Unit tests, functional tests)
     5unit/            test sources (Unit tests, functional tests)
    66
    77config/          configuration files for running tests
    88
    9                  Note: make sure this directory is on the classpath when unit tests
    10                  are executed. Unit tests look for the configuration files
    11                  'test-unit-env.properties'.
    12                  
    139data/            test data
    14 
    15 josm.home/       Some unit test have to run in the context of a running JOSM instance.
    16                  This is the home directory for this JOSM instance. It includes
    17                  a preferences files with default entries.
    18 
    19 lib/             Additional libraries used for testing
    20 
Note: See TracChangeset for help on using the changeset viewer.