Changeset 30550 in osm for applications/editors/josm


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
Files:
22 added
6 deleted
25 edited
6 moved

Legend:

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

    r30416 r30550  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="src" path="test"/>
     4        <classpathentry kind="src" path="test/unit"/>
    55        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
    66        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
  • applications/editors/josm/plugins/ElevationProfile/test

    • Property svn:externals set to
    • Property svn:ignore set to
      build
      jacoco.exec
      report
  • applications/editors/josm/plugins/ElevationProfile/test/unit/org/openstreetmap/josm/plugins/elevation/tests/EleVertexTest.java

    r30344 r30550  
    5454        EleCoordinate c2 = new EleCoordinate(new LatLon(50.8328, 7.9217), 200);
    5555        EleCoordinate c3 = new EleCoordinate(new LatLon(50.9558, 7.9217), 400);
    56         EleCoordinate c4 = new EleCoordinate(new LatLon(50.5767627, 9.1938483), 100);
     56        /*EleCoordinate c4 =*/ new EleCoordinate(new LatLon(50.5767627, 9.1938483), 100);
    5757
    5858        EleVertex v1 = new EleVertex(c1, c2, c3);
  • applications/editors/josm/plugins/alignways/.classpath

    r30416 r30550  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
     4        <classpathentry kind="src" path="test/unit"/>
    45        <classpathentry combineaccessrules="false" exported="true" kind="src" path="/JOSM"/>
    56        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    6         <classpathentry kind="lib" path="lib"/>
    77        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    88        <classpathentry kind="output" path="build"/>
  • applications/editors/josm/plugins/alignways/build.xml

    r30530 r30550  
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    66    <property name="plugin.main.version" value="7001"/>
    7     <!--
    8         ************************************************ ** should not be
    9         necessary to change the following properties
     7
     8    <!-- Configure these properties (replace "..." accordingly).
     9         See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
    1010    -->
    11     <property name="josm" location="../../core/dist/josm-custom.jar"/>
    12     <property name="plugin.build.dir" value="build"/>
    13     <property name="plugin.src.dir" value="src"/>
    14     <property name="plugin.lib.dir" value="lib"/>
    15     <!-- this is the directory where the plugin jar is copied to -->
    16     <property name="plugin.dist.dir" value="../../dist"/>
    17     <property name="ant.build.javac.target" value="1.7"/>
    18     <property name="plugin.dist.dir" value="../../dist"/>
    19     <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    20     <!--
    21         ********************************************************** ** init -
    22         initializes the build
    23         **********************************************************
    24     -->
    25     <target name="init">
    26         <mkdir dir="${plugin.build.dir}"/>
    27     </target>
    28     <!--
    29         ********************************************************** ** compile
    30         - complies the source tree
    31         **********************************************************
    32     -->
    33     <target name="compile" depends="init">
    34         <echo message="compiling sources for  ${plugin.jar} ... "/>
    35         <javac srcdir="src" classpath="${josm};${plugin.lib.dir}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false">
    36             <compilerarg value="-Xlint:deprecation"/>
    37             <compilerarg value="-Xlint:unchecked"/>
    38         </javac>
    39         <copy todir="${plugin.build.dir}">
    40             <fileset dir="lib"/>
    41         </copy>
    42     </target>
    43     <!--
    44         ********************************************************** ** dist -
    45         creates the plugin jar
    46         **********************************************************
    47     -->
    48     <target name="dist" depends="compile,revision">
    49         <echo message="creating ${ant.project.name}.jar ... "/>
    50         <copy todir="${plugin.build.dir}/resources">
    51             <fileset dir="resources"/>
    52         </copy>
    53         <copy todir="${plugin.build.dir}/images">
    54             <fileset dir="images"/>
    55         </copy>
    56         <copy todir="${plugin.build.dir}/data">
    57             <fileset dir="data"/>
    58         </copy>
    59         <copy todir="${plugin.build.dir}">
    60             <fileset dir=".">
    61                 <include name="README"/>
    62                 <include name="LICENSE"/>
    63             </fileset>
    64         </copy>
    65         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    66             <!--
    67                 ************************************************ ** configure these
    68                 properties. Most of them will be copied to the plugins ** manifest
    69                 file. Property values will also show up in the list available **
    70                 plugins: http://josm.openstreetmap.de/wiki/Plugins. **
    71                 ************************************************
    72             -->
    73             <manifest>
    74                 <attribute name="Author" value="Attila Szász"/>
    75                 <attribute name="Plugin-Class" value="com.tilusnet.josm.plugins.alignways.AlignWaysPlugin"/>
    76                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    77                 <attribute name="Plugin-Description" value="Makes a pair of selected way segments parallel by rotating one of them around a chosen pivot."/>
    78                 <attribute name="Plugin-Icon" value="images/alignways.png"/>
    79                 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    80                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    81                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AlignWayS"/>
    82             </manifest>
    83         </jar>
    84     </target>
    85     <!--
    86         ********************************************************** ** revision
    87         - extracts the current revision number for the ** file build.number
    88         and stores it in the XML property ** version.*
    89         **********************************************************
    90     -->
    91     <target name="revision">
    92         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    93             <env key="LANG" value="C"/>
    94             <arg value="info"/>
    95             <arg value="--xml"/>
    96             <arg value="."/>
    97         </exec>
    98         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    99         <delete file="REVISION"/>
    100     </target>
    101     <!--
    102         ********************************************************** ** clean -
    103         clean up the build environment
    104         **********************************************************
    105     -->
    106     <target name="clean">
    107         <delete dir="${plugin.build.dir}"/>
    108         <delete file="${plugin.jar}"/>
    109     </target>
    110     <!--
    111         ********************************************************** ** install
    112         - install the plugin in your local JOSM installation
    113         **********************************************************
    114     -->
    115     <target name="install" depends="dist">
    116         <property environment="env"/>
    117         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    118             <and>
    119                 <os family="windows"/>
    120             </and>
    121         </condition>
    122         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    123     </target>
    124     <!--
    125         ************************** Publishing the plugin
    126         ***********************************
    127     -->
    128     <!--
    129         ** extracts the JOSM release for the JOSM version in ../core and saves
    130         it in the ** property ${coreversion.info.entry.revision} **
    131     -->
    132     <target name="core-info">
    133         <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
    134             <env key="LANG" value="C"/>
    135             <arg value="info"/>
    136             <arg value="--xml"/>
    137             <arg value="../../core"/>
    138         </exec>
    139         <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    140         <echo>Building against core revision
    141             ${coreversion.info.entry.revision}.</echo>
    142         <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    143         <delete file="core.info.xml"/>
    144     </target>
    145     <!--
    146         ** commits the source tree for this plugin
    147         -->
    148     <target name="commit-current">
    149         <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    150         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    151             <env key="LANG" value="C"/>
    152             <arg value="commit"/>
    153             <arg value="-m '${commit.message}'"/>
    154             <arg value="."/>
    155         </exec>
    156     </target>
    157     <!--
    158         ** updates (svn up) the source tree for this plugin
    159         -->
    160     <target name="update-current">
    161         <echo>Updating plugin source ...</echo>
    162         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    163             <env key="LANG" value="C"/>
    164             <arg value="up"/>
    165             <arg value="."/>
    166         </exec>
    167         <echo>Updating ${plugin.jar} ...</echo>
    168         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    169             <env key="LANG" value="C"/>
    170             <arg value="up"/>
    171             <arg value="../dist/${plugin.jar}"/>
    172         </exec>
    173     </target>
    174     <!--
    175         ** commits the plugin.jar
    176         -->
    177     <target name="commit-dist">
    178         <echo>
    179             ***** Properties of published ${plugin.jar} *****
    180             Commit message
    181             : '${commit.message}'
    182             Plugin-Mainversion: ${plugin.main.version}
    183             JOSM
    184             build version: ${coreversion.info.entry.revision}
    185             Plugin-Version :
    186             ${version.entry.commit.revision}
    187             ***** / Properties of published
    188             ${plugin.jar} *****
     11    <property name="plugin.author" value="Attila Szász"/>
     12    <property name="plugin.class" value="com.tilusnet.josm.plugins.alignways.AlignWaysPlugin"/>
     13    <property name="plugin.description" value="Makes a pair of selected way segments parallel by rotating one of them around a chosen pivot."/>
     14    <property name="plugin.icon" value="images/alignways.png"/>
     15    <property name="plugin.link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AlignWayS"/>
    18916
    190             Now commiting ${plugin.jar} ...
    191     </echo>
    192         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    193             <env key="LANG" value="C"/>
    194             <arg value="-m '${commit.message}'"/>
    195             <arg value="commit"/>
    196             <arg value="${plugin.jar}"/>
    197         </exec>
    198     </target>
    199     <!-- ** make sure svn is present as a command line tool ** -->
    200     <target name="ensure-svn-present">
    201         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
    202             <env key="LANG" value="C"/>
    203             <arg value="--version"/>
    204         </exec>
    205         <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
    206             <!-- return code not set at all? Most likely svn isn't installed -->
    207             <condition>
    208                 <not>
    209                     <isset property="svn.exit.code"/>
    210                 </not>
    211             </condition>
    212         </fail>
    213         <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
    214             <!--
    215                 error code from SVN? Most likely svn is not what we are looking on
    216                 this system
    217             -->
    218             <condition>
    219                 <isfailure code="${svn.exit.code}"/>
    220             </condition>
    221         </fail>
    222     </target>
    223     <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    224     </target>
     17    <!-- ** include targets that all plugins have in common ** -->
     18    <import file="../build-common.xml"/>
    22519</project>
  • applications/editors/josm/plugins/alignways/nbproject/project.xml

    r30416 r30550  
    7070            <compilation-unit>
    7171                <package-root>src</package-root>
    72                 <classpath mode="compile">../../core/src;lib</classpath>
     72                <classpath mode="compile">../../core/src</classpath>
    7373                <source-level>1.7</source-level>
    7474            </compilation-unit>
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysTipsPanel.java

    r28624 r30550  
    99import java.awt.Dimension;
    1010
     11import javax.swing.GroupLayout;
    1112import javax.swing.ImageIcon;
    1213import javax.swing.JCheckBox;
     
    1516import javax.swing.JScrollPane;
    1617import javax.swing.JSeparator;
     18import javax.swing.LayoutStyle;
    1719import javax.swing.ScrollPaneConstants;
    1820import javax.swing.SwingConstants;
    19 
    20 import org.jdesktop.layout.GroupLayout;
    21 import org.jdesktop.layout.LayoutStyle;
    2221
    2322/**
     
    6463        Title.setLayout(TitleLayout);
    6564        TitleLayout.setHorizontalGroup(
    66                 TitleLayout.createParallelGroup(GroupLayout.LEADING)
    67                 .add(GroupLayout.TRAILING, TitleLayout.createSequentialGroup()
    68                         .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
    69                         .addPreferredGap(LayoutStyle.RELATED)
    70                         .add(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE))
     65                TitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     66                .addGroup(GroupLayout.Alignment.TRAILING, TitleLayout.createSequentialGroup()
     67                        .addComponent(WelcomeTo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
     68                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     69                        .addComponent(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE))
    7170                );
    7271        TitleLayout.setVerticalGroup(
    73                 TitleLayout.createParallelGroup(GroupLayout.LEADING)
    74                 .add(TitleLayout.createSequentialGroup()
    75                         .add(Icon)
     72                TitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     73                .addGroup(TitleLayout.createSequentialGroup()
     74                        .addComponent(Icon)
    7675                        .addContainerGap())
    77                         .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
     76                        .addComponent(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
    7877                );
    7978
     
    110109        steps.setLayout(stepsLayout);
    111110        stepsLayout.setHorizontalGroup(
    112                 stepsLayout.createParallelGroup(GroupLayout.LEADING)
    113                 .add(stepsLayout.createSequentialGroup()
    114                         .addContainerGap()
    115                         .add(stepsLayout.createParallelGroup(GroupLayout.TRAILING)
    116                                 .add(GroupLayout.LEADING, lastHint, 0, 0, Short.MAX_VALUE)
    117                                 .add(GroupLayout.LEADING, step04, 0, 0, Short.MAX_VALUE)
    118                                 .add(GroupLayout.LEADING, step03, 0, 0, Short.MAX_VALUE)
    119                                 .add(GroupLayout.LEADING, step02, 0, 0, Short.MAX_VALUE)
    120                                 .add(GroupLayout.LEADING, step01, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE))
    121                                 .add(18, 18, 18))
     111                stepsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     112                .addGroup(stepsLayout.createSequentialGroup()
     113                        .addContainerGap()
     114                        .addGroup(stepsLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
     115                                .addComponent(lastHint, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     116                                .addComponent(step04, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     117                                .addComponent(step03, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     118                                .addComponent(step02, GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
     119                                .addComponent(step01, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE))
     120                                .addGap(18, 18, 18))
    122121                );
    123122        stepsLayout.setVerticalGroup(
    124                 stepsLayout.createParallelGroup(GroupLayout.LEADING)
    125                 .add(stepsLayout.createSequentialGroup()
    126                         .add(step01, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    127                         .addPreferredGap(LayoutStyle.RELATED)
    128                         .add(step02, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    129                         .addPreferredGap(LayoutStyle.RELATED)
    130                         .add(step03, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    131                         .addPreferredGap(LayoutStyle.RELATED)
    132                         .add(step04, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    133                         .addPreferredGap(LayoutStyle.RELATED)
    134                         .add(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     123                stepsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     124                .addGroup(stepsLayout.createSequentialGroup()
     125                        .addComponent(step01, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     126                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     127                        .addComponent(step02, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     128                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     129                        .addComponent(step03, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     130                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     131                        .addComponent(step04, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     132                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     133                        .addComponent(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    135134                        .addContainerGap(22, Short.MAX_VALUE))
    136135                );
     
    143142        Intro.setLayout(IntroLayout);
    144143        IntroLayout.setHorizontalGroup(
    145                 IntroLayout.createParallelGroup(GroupLayout.LEADING)
    146                 .add(IntroLayout.createSequentialGroup()
    147                         .addContainerGap()
    148                         .add(dontShow, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE)
     144                IntroLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     145                .addGroup(IntroLayout.createSequentialGroup()
     146                        .addContainerGap()
     147                        .addComponent(dontShow, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE)
    149148                        .addContainerGap(283, Short.MAX_VALUE))
    150                         .add(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
    151                         .add(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
     149                        .addComponent(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
     150                        .addComponent(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
    152151                );
    153152        IntroLayout.setVerticalGroup(
    154                 IntroLayout.createParallelGroup(GroupLayout.LEADING)
    155                 .add(GroupLayout.TRAILING, IntroLayout.createSequentialGroup()
    156                         .add(introText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    157                         .addPreferredGap(LayoutStyle.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    158                         .add(scrollableSteps, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
    159                         .addPreferredGap(LayoutStyle.UNRELATED)
    160                         .add(dontShow)
     153                IntroLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
     154                .addGroup(GroupLayout.Alignment.TRAILING, IntroLayout.createSequentialGroup()
     155                        .addComponent(introText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     156                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
     157                        .addComponent(scrollableSteps, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
     158                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
     159                        .addComponent(dontShow)
    161160                        .addContainerGap())
    162161                );
     
    165164        this.setLayout(layout);
    166165        layout.setHorizontalGroup(
    167                 layout.createParallelGroup(GroupLayout.LEADING)
    168                 .add(GroupLayout.TRAILING, layout.createSequentialGroup()
    169                         .addContainerGap()
    170                         .add(layout.createParallelGroup(GroupLayout.TRAILING)
    171                                 .add(GroupLayout.LEADING, separator, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
    172                                 .add(Title, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    173                                 .add(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
     166                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
     167                .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
     168                        .addContainerGap()
     169                        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
     170                                .addComponent(separator, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
     171                                .addComponent(Title, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
     172                                .addComponent(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    174173                                .addContainerGap())
    175174                );
    176175        layout.setVerticalGroup(
    177                 layout.createParallelGroup(GroupLayout.LEADING)
    178                 .add(layout.createSequentialGroup()
    179                         .addContainerGap()
    180                         .add(Title, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    181                         .addPreferredGap(LayoutStyle.UNRELATED)
    182                         .add(separator, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
    183                         .addPreferredGap(LayoutStyle.RELATED)
    184                         .add(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     176                layout.createParallelGroup(GroupLayout.Alignment.LEADING)
     177                .addGroup(layout.createSequentialGroup()
     178                        .addContainerGap()
     179                        .addComponent(Title, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
     180                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
     181                        .addComponent(separator, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
     182                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
     183                        .addComponent(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    185184                        .addContainerGap(45, Short.MAX_VALUE))
    186185                );
     
    206205        return dontShow.isSelected();
    207206    }
    208 
    209207}
  • applications/editors/josm/plugins/alignways/test

    • Property svn:externals set to
    • Property svn:ignore set to
      build
      jacoco.exec
      report
  • applications/editors/josm/plugins/build-common.xml

    r30416 r30550  
    1111**
    1212-->
    13 <project name="plugin_common" basedir=".">
     13<project name="plugin_common" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
    1414
    1515    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    16     <property name="plugin.build.dir"       value="build"/>
    17     <property name="plugin.src.dir"         value="src"/>
    18     <property name="plugin.lib.dir"         value="lib"/>
     16    <property name="groovy.jar"             location="../00_core_tools/groovy-all-2.3.4.jar"/>
     17    <property name="plugin.build.dir"       location="build"/>
     18    <property name="plugin.test.dir"        location="test"/>
     19    <property name="plugin.src.dir"         location="src"/>
     20    <property name="plugin.lib.dir"         location="lib"/>
    1921    <!-- this is the directory where the plugin jar is copied to -->
    20     <property name="plugin.dist.dir"        value="../../dist"/>
     22    <property name="plugin.dist.dir"        location="../../dist"/>
    2123    <property name="ant.build.javac.target" value="1.7"/>
    2224    <property name="ant.build.javac.source" value="1.7"/>
    23     <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
     25    <property name="plugin.jar"             location="${plugin.dist.dir}/${ant.project.name}.jar"/>
    2426
    2527    <!--
     
    350352    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    351353    </target>
    352 
     354       
     355    <path id="test.classpath">
     356        <fileset dir="../../core/test/lib">
     357            <include name="**/*.jar"/>
     358        </fileset>
     359        <fileset dir="${plugin.test.dir}/lib" erroronmissingdir="no">
     360            <include name="**/*.jar"/>
     361        </fileset>
     362        <fileset dir="lib" erroronmissingdir="no">
     363            <include name="**/*.jar"/>
     364        </fileset>
     365        <pathelement path="../../core/test/build/unit"/>
     366        <pathelement path="${josm}"/>
     367        <pathelement path="${plugin.jar}"/>
     368        <pathelement path="${groovy.jar}"/>
     369    </path>
     370    <macrodef name="init-test-preferences">
     371        <attribute name="testfamily"/>
     372        <sequential>
     373            <copy file="${plugin.test.dir}/config/preferences.template.xml" tofile="${plugin.test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
     374            <replace file="${plugin.test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
     375            <replace file="${plugin.test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
     376        </sequential>
     377    </macrodef>
     378    <target name="test-init">
     379        <mkdir dir="${plugin.test.dir}/build"/>
     380        <mkdir dir="${plugin.test.dir}/build/unit"/>
     381        <mkdir dir="${plugin.test.dir}/report"/>
     382        <init-test-preferences testfamily="unit"/>
     383    </target>
     384    <target name="test-clean">
     385        <delete dir="${plugin.test.dir}/build"/>
     386        <delete dir="${plugin.test.dir}/report"/>
     387        <delete file="${plugin.test.dir}/jacoco.exec" />
     388        <delete file="${plugin.test.dir}/config/unit-josm.home/preferences.xml" />
     389        <delete dir="${plugin.test.dir}/config/unit-josm.home/cache" failonerror="false"/>
     390    </target>
     391    <macrodef name="call-groovyc">
     392        <attribute name="testfamily"/>
     393        <element name="cp-elements"/>
     394        <sequential>
     395            <groovyc srcdir="${plugin.test.dir}/@{testfamily}" destdir="${plugin.test.dir}/build/@{testfamily}" encoding="UTF-8">
     396                <classpath>
     397                    <cp-elements/>
     398                </classpath>
     399                <javac target="1.7" source="1.7" debug="on">
     400                    <compilerarg value="-Xlint:all"/>
     401                    <compilerarg value="-Xlint:-serial"/>
     402                </javac>
     403            </groovyc>
     404        </sequential>
     405    </macrodef>
     406    <target name="test-compile" depends="test-init,dist">
     407        <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/>
     408        <call-groovyc testfamily="unit">
     409            <cp-elements>
     410                <path refid="test.classpath"/>
     411            </cp-elements>
     412        </call-groovyc>
     413    </target>
     414    <macrodef name="call-junit">
     415        <attribute name="testfamily"/>
     416        <sequential>
     417            <echo message="Running @{testfamily} tests with JUnit"/>
     418            <jacoco:coverage destfile="${plugin.test.dir}/jacoco.exec">
     419                <junit printsummary="yes" fork="true" forkmode="once">
     420                    <sysproperty key="josm.home" value="${plugin.test.dir}/config/@{testfamily}-josm.home"/>
     421                    <sysproperty key="josm.test.data" value="${plugin.test.dir}/data"/>
     422                    <sysproperty key="java.awt.headless" value="true"/>
     423                    <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
     424                    <classpath>
     425                        <path refid="test.classpath"/>
     426                        <pathelement path="${plugin.test.dir}/build/unit"/>
     427                        <pathelement path="${plugin.test.dir}/build/@{testfamily}"/>
     428                        <pathelement path="${plugin.test.dir}/config"/>
     429                    </classpath>
     430                    <formatter type="plain"/>
     431                    <formatter type="xml"/>
     432                    <batchtest fork="yes" todir="${plugin.test.dir}/report">
     433                        <fileset dir="${plugin.test.dir}/build/@{testfamily}" includes="**/*Test.class"/>
     434                    </batchtest>
     435                </junit>
     436            </jacoco:coverage>
     437        </sequential>
     438    </macrodef>
     439    <target name="test" depends="test-compile"
     440        description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
     441        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" />
     442        <call-junit testfamily="unit"/>
     443    </target>
     444       
    353445    <target name="runjosm" depends="install">
    354446        <java jar="${josm}" fork="true">
     
    371463    * dist        This default target builds the plugin jar file
    372464    * clean       Cleanup automatical created files
     465        * test        Run unit tests (if any)
    373466    * publish     Checkin source code, build jar and checkin plugin jar
    374467                  (requires proper entry for SVN commit message!)
  • applications/editors/josm/plugins/build.xml

    r30545 r30550  
    211211    <target name="clean_install"/>
    212212    <target name="install" depends="dist"/>
     213    <target name="test">
     214        <ant antfile="build.xml" target="test" dir="alignways"/>
     215        <ant antfile="build.xml" target="test" dir="ElevationProfile"/>
     216        <ant antfile="build.xml" target="test" dir="graphview"/>
     217        <ant antfile="build.xml" target="test" dir="opendata"/>
     218        <ant antfile="build.xml" target="test" dir="turnrestrictions"/>
     219        <ant antfile="build.xml" target="test" dir="wikipedia"/>
     220    </target>
    213221</project>
  • applications/editors/josm/plugins/graphview/.classpath

    r30416 r30550  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
     4        <classpathentry kind="src" path="test/unit"/>
    45        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
     6        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    57        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
    68        <classpathentry kind="output" path="build"/>
  • applications/editors/josm/plugins/graphview/build.xml

    r30530 r30550  
    33    <property name="commit.message" value="option to change graph colors; closes ticket 5523 in JOSM Trac"/>
    44    <property name="plugin.main.version" value="7001"/>
    5     <property name="josm" location="../../core/dist/josm-custom.jar"/>
    6     <property name="plugin.build.dir" value="build"/>
    7     <property name="plugin.src.dir" value="src"/>
    8     <!-- this is the directory where the plugin jar is copied to -->
    9     <property name="plugin.dist.dir" value="../../dist"/>
    10     <property name="ant.build.javac.target" value="1.7"/>
    11     <property name="plugin.dist.dir" value="../../dist"/>
    12     <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    13     <!--
    14     **********************************************************
    15     ** init - initializes the build
    16     **********************************************************
     5
     6    <!-- Configure these properties (replace "..." accordingly).
     7         See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
    178    -->
    18     <target name="init">
    19         <mkdir dir="${plugin.build.dir}"/>
    20     </target>
    21     <!--
    22     **********************************************************
    23     ** compile - complies the source tree
    24     **********************************************************
    25     -->
    26     <target name="compile" depends="init">
    27         <echo message="compiling sources for  ${plugin.jar} ... "/>
    28         <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false">
    29             <compilerarg value="-Xlint:deprecation"/>
    30             <compilerarg value="-Xlint:unchecked"/>
    31         </javac>
    32     </target>
    33     <!--
    34     **********************************************************
    35     ** dist - creates the plugin jar
    36     **********************************************************
    37     -->
    38     <target name="dist" depends="compile,revision">
    39         <echo message="creating ${plugin.jar} ... "/>
    40         <copy todir="${plugin.build.dir}/images">
    41             <fileset dir="images"/>
    42         </copy>
    43         <copy todir="${plugin.build.dir}/data">
    44             <fileset dir="data"/>
    45         </copy>
    46         <copy todir="${plugin.build.dir}/files">
    47             <fileset dir="files"/>
    48         </copy>
    49         <copy todir="${plugin.build.dir}">
    50             <fileset dir=".">
    51                 <include name="LICENSE"/>
    52             </fileset>
    53         </copy>
    54         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    55             <manifest>
    56                 <attribute name="Author" value="Tobias Knerr"/>
    57                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.graphview.plugin.GraphViewPlugin"/>
    58                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    59                 <attribute name="Plugin-Description" value="Visualizes routing information as a routing graph."/>
    60                 <attribute name="Plugin-Icon" value="images/preferences/graphview.png"/>
    61                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Graphview"/>
    62                 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    63                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    64             </manifest>
    65         </jar>
    66     </target>
    67     <!--
    68     **********************************************************
    69     ** revision - extracts the current revision number for the
    70     **    file build.number and stores it in the XML property
    71     **    version.*
    72     **********************************************************
    73     -->
    74     <target name="revision">
    75         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    76             <env key="LANG" value="C"/>
    77             <arg value="info"/>
    78             <arg value="--xml"/>
    79             <arg value="."/>
    80         </exec>
    81         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    82         <delete file="REVISION"/>
    83     </target>
    84     <!--
    85     **********************************************************
    86     ** clean - clean up the build environment
    87     **********************************************************
    88     -->
    89     <target name="clean">
    90         <delete dir="${plugin.build.dir}"/>
    91         <delete file="${plugin.jar}"/>
    92     </target>
    93     <!--
    94     **********************************************************
    95     ** install - install the plugin in your local JOSM installation
    96     **********************************************************
    97     -->
    98     <target name="install" depends="dist">
    99         <property environment="env"/>
    100         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    101             <and>
    102                 <os family="windows"/>
    103             </and>
    104         </condition>
    105         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    106     </target>
    107     <!--
    108          ************************** Publishing the plugin ***********************************
    109         -->
    110     <!--
    111         ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    112         ** property ${coreversion.info.entry.revision}
    113         **
    114         -->
    115     <target name="core-info">
    116         <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
    117             <env key="LANG" value="C"/>
    118             <arg value="info"/>
    119             <arg value="--xml"/>
    120             <arg value="../../core"/>
    121         </exec>
    122         <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    123         <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    124         <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    125         <delete file="core.info.xml"/>
    126     </target>
    127     <!--
    128         ** commits the source tree for this plugin
    129         -->
    130     <target name="commit-current">
    131         <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    132         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    133             <env key="LANG" value="C"/>
    134             <arg value="commit"/>
    135             <arg value="-m '${commit.message}'"/>
    136             <arg value="."/>
    137         </exec>
    138     </target>
    139     <!--
    140         ** updates (svn up) the source tree for this plugin
    141         -->
    142     <target name="update-current">
    143         <echo>Updating plugin source ...</echo>
    144         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    145             <env key="LANG" value="C"/>
    146             <arg value="up"/>
    147             <arg value="."/>
    148         </exec>
    149         <echo>Updating ${plugin.jar} ...</echo>
    150         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    151             <env key="LANG" value="C"/>
    152             <arg value="up"/>
    153             <arg value="../dist/${plugin.jar}"/>
    154         </exec>
    155     </target>
    156     <!--
    157         ** commits the plugin.jar
    158         -->
    159     <target name="commit-dist">
    160         <echo>
    161     ***** Properties of published ${plugin.jar} *****
    162     Commit message    : '${commit.message}'
    163     Plugin-Mainversion: ${plugin.main.version}
    164     JOSM build version: ${coreversion.info.entry.revision}
    165     Plugin-Version    : ${version.entry.commit.revision}
    166     ***** / Properties of published ${plugin.jar} *****
     9    <property name="plugin.author" value="Tobias Knerr"/>
     10    <property name="plugin.class" value="org.openstreetmap.josm.plugins.graphview.plugin.GraphViewPlugin"/>
     11    <property name="plugin.description" value="Visualizes routing information as a routing graph."/>
     12    <property name="plugin.icon" value="images/preferences/graphview.png"/>
     13    <property name="plugin.link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Graphview"/>
    16714
    168     Now commiting ${plugin.jar} ...
    169     </echo>
    170         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    171             <env key="LANG" value="C"/>
    172             <arg value="-m '${commit.message}'"/>
    173             <arg value="commit"/>
    174             <arg value="${plugin.jar}"/>
    175         </exec>
    176     </target>
    177     <!-- ** make sure svn is present as a command line tool ** -->
    178     <target name="ensure-svn-present">
    179         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
    180             <env key="LANG" value="C"/>
    181             <arg value="--version"/>
    182         </exec>
    183         <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
    184             <!-- return code not set at all? Most likely svn isn't installed -->
    185             <condition>
    186                 <not>
    187                     <isset property="svn.exit.code"/>
    188                 </not>
    189             </condition>
    190         </fail>
    191         <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
    192             <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
    193             <condition>
    194                 <isfailure code="${svn.exit.code}"/>
    195             </condition>
    196         </fail>
    197     </target>
    198     <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    199         </target>
     15    <!-- ** include targets that all plugins have in common ** -->
     16    <import file="../build-common.xml"/>
    20017</project>
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/InternalRuleset.java

    r23189 r30550  
    33public enum InternalRuleset {
    44
    5     DEFAULT("files/accessRuleset.xml"),
    6     GERMANY("files/accessRuleset_de.xml");
     5    DEFAULT("resources/accessRuleset.xml"),
     6    GERMANY("resources/accessRuleset_de.xml");
    77
    88    private String resourceName;
  • applications/editors/josm/plugins/graphview/test

    • Property svn:externals set to
    • Property svn:ignore set to
      build
      jacoco.exec
      report
  • applications/editors/josm/plugins/graphview/test/unit/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReaderTest.java

    r23189 r30550  
    2525    public void testReadAccessRuleset_valid_classes() throws IOException {
    2626
    27         InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
     27        InputStream is = new FileInputStream("plugins/graphview/test/data/accessRuleset_valid.xml");
    2828        AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
    2929        assertNotNull(ruleset);
     
    5151    public void testReadAccessRuleset_valid_basetags() throws IOException {
    5252
    53         InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
     53        InputStream is = new FileInputStream("plugins/graphview/test/data/accessRuleset_valid.xml");
    5454        AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
    5555        assertNotNull(ruleset);
     
    6767    public void testReadAccessRuleset_valid_implications() throws IOException {
    6868
    69         InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
     69        InputStream is = new FileInputStream("plugins/graphview/test/data/accessRuleset_valid.xml");
    7070        AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
    7171        assertNotNull(ruleset);
     
    107107        return new MapBasedTagGroup(tagMap);
    108108    }
    109 
    110109}
  • applications/editors/josm/plugins/graphview/test/unit/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogicTest.java

    r23189 r30550  
    11package org.openstreetmap.josm.plugins.graphview.core.util;
    2 import static junit.framework.Assert.assertFalse;
    3 import static junit.framework.Assert.assertTrue;
     2import static org.junit.Assert.assertFalse;
     3import static org.junit.Assert.assertTrue;
    44
    55import java.util.Arrays;
  • applications/editors/josm/plugins/graphview/test/unit/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParserTest.java

    r23189 r30550  
    11package org.openstreetmap.josm.plugins.graphview.core.util;
    22
    3 import static junit.framework.Assert.assertNull;
     3import static org.junit.Assert.assertNull;
    44import static org.openstreetmap.josm.plugins.graphview.core.util.ValueStringParser.parseMeasure;
    55import static org.openstreetmap.josm.plugins.graphview.core.util.ValueStringParser.parseSpeed;
  • applications/editors/josm/plugins/opendata/.classpath

    r30416 r30550  
    1515        <classpathentry kind="src" path="modules/fr.toulouse/resources"/>
    1616        <classpathentry kind="src" path="util"/>
     17        <classpathentry kind="src" path="test/unit"/>
    1718        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    1819        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
     
    2021        <classpathentry combineaccessrules="false" kind="src" path="/JOSM-GeoTools"/>
    2122        <classpathentry combineaccessrules="false" kind="src" path="/JOSM-jts"/>
     23        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    2224        <classpathentry kind="output" path="bin"/>
    2325</classpath>
  • 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 
  • applications/editors/josm/plugins/wikipedia/.classpath

    r30416 r30550  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
     4        <classpathentry kind="src" path="test/unit"/>
    45        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
    56        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
     7        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    68        <classpathentry kind="output" path="bin"/>
    79</classpath>
  • applications/editors/josm/plugins/wikipedia/test

    • Property svn:externals set to
  • applications/editors/josm/plugins/wikipedia/test/unit/org/wikipedia/WikipediaAppTest.java

    r30448 r30550  
    1212import java.util.List;
    1313
     14import static org.hamcrest.CoreMatchers.hasItem;
    1415import static org.hamcrest.CoreMatchers.is;
    1516import static org.hamcrest.CoreMatchers.nullValue;
    1617import static org.junit.Assert.assertThat;
    1718import static org.junit.Assert.assertTrue;
    18 import static org.junit.matchers.JUnitMatchers.hasItem;
    1919
    2020public class WikipediaAppTest {
    2121
    2222    @Test
    23     @SuppressWarnings("unchecked")
    2423    public void testPartitionList() {
    2524        assertThat(
Note: See TracChangeset for help on using the changeset viewer.