Changeset 7040 in josm


Ignore:
Timestamp:
2014-05-02T00:04:06+02:00 (10 years ago)
Author:
Don-vip
Message:

tests/build update:

  • update Jacoco to version 0.7.0
  • compile performance tests even if not run by ant task
  • do not create empty package-info.class files in javac task
  • move RemoteControl test to unit tests to get coverage information
  • fix NPEs seen in tests in headless mode
  • proper test failures when properties files can not be loaded


Location:
trunk
Files:
1 added
1 deleted
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r7027 r7040  
    199199        <!-- COTS -->
    200200        <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**,org/glassfish/**" nowarn="on"
    201                 destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="iso-8859-1">
     201                destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="iso-8859-1">
    202202            <!-- get rid of "internal proprietary API" warning -->
    203203                <compilerarg value="-XDignore.symbol.file"/>
     
    205205        <!-- JMapViewer/JOSM -->
    206206        <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java"
    207                 destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="UTF-8">
     207                destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    208208            <compilerarg value="-Xlint:cast"/>
    209209            <compilerarg value="-Xlint:deprecation"/>
     
    268268    </target>
    269269    <target name="test-compile" depends="test-init,dist">
    270         <javac srcdir="${test.dir}/unit" classpathref="test.classpath" destdir="${test.dir}/build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="UTF-8">
     270        <javac srcdir="${test.dir}/unit" classpathref="test.classpath" destdir="${test.dir}/build" target="1.7" source="1.7" debug="on"
     271                includeantruntime="false" createMissingPackageInfoClass="off" encoding="UTF-8">
    271272            <compilerarg value="-Xlint:all"/>
    272273            <compilerarg value="-Xlint:-serial"/>
    273274        </javac>
    274         <javac srcdir="${test.dir}/functional" classpathref="test.classpath" destdir="${test.dir}/build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="UTF-8">
     275        <javac srcdir="${test.dir}/functional" classpathref="test.classpath" destdir="${test.dir}/build" target="1.7" source="1.7" debug="on"
     276                includeantruntime="false" createMissingPackageInfoClass="off" encoding="UTF-8">
     277            <compilerarg value="-Xlint:all"/>
     278            <compilerarg value="-Xlint:-serial"/>
     279        </javac>
     280        <javac srcdir="${test.dir}/performance" classpathref="test.classpath" destdir="${test.dir}/build" target="1.7" source="1.7" debug="on"
     281                includeantruntime="false" createMissingPackageInfoClass="off" encoding="UTF-8">
    275282            <compilerarg value="-Xlint:all"/>
    276283            <compilerarg value="-Xlint:-serial"/>
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java

    r6920 r7040  
    1818    private final Rectangle clipBounds;
    1919
     20    /**
     21     * Constructs a new {@code LineClip}.
     22     * @param p1 start point of the clipped line
     23     * @param p2 end point of the clipped line
     24     * @param clipBounds Clip bounds
     25     */
    2026    public LineClip(Point p1, Point p2, Rectangle clipBounds) {
    2127        this.p1 = p1;
     
    2935     */
    3036    public boolean execute() {
     37        if (clipBounds == null) {
     38            return false;
     39        }
    3140        return cohenSutherland(p1.x, p1.y, p2.x, p2.y, clipBounds.x , clipBounds.y, clipBounds.x + clipBounds.width, clipBounds.y + clipBounds.height);
    3241    }
     
    3544     * @return start point of the clipped line
    3645     */
    37     public Point getP1()
    38     {
     46    public Point getP1() {
    3947        return p1;
    4048    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r7023 r7040  
    11751175        GeneralPath onewayArrowsCasing = showOneway ? new GeneralPath() : null;
    11761176        Rectangle bounds = g.getClipBounds();
    1177         bounds.grow(100, 100);                  // avoid arrow heads at the border
     1177        if (bounds != null) {
     1178            // avoid arrow heads at the border
     1179            bounds.grow(100, 100);
     1180        }
    11781181
    11791182        double wayLength = 0;
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r7030 r7040  
    141141        //
    142142        try (InputStream is = MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties")) {
     143            if (is == null) {
     144                throw new IOException();
     145            }
    143146            testProperties.load(is);
    144147        } catch(IOException e){
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r7030 r7040  
    148148        //
    149149        try (InputStream is = MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties")) {
     150            if (is == null) {
     151                throw new IOException();
     152            }
    150153            testProperties.load(is);
    151154        } catch(IOException e){
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java

    r2448 r7040  
    1919
    2020    @Test
    21     public void test1()  throws OsmTransferException {
     21    public void testNode()  throws OsmTransferException {
    2222        OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.NODE,266187);
    2323        HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
     
    2727
    2828    @Test
    29     public void test2()  throws OsmTransferException {
    30         OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.WAY,32916);
     29    public void testWay()  throws OsmTransferException {
     30        OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.WAY,3058844);
    3131        HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
    32         History h = ds.getHistory(32916, OsmPrimitiveType.WAY);
     32        History h = ds.getHistory(3058844, OsmPrimitiveType.WAY);
    3333        System.out.println("num versions: " + h.getNumVersions());
    3434    }
    3535
    3636    @Test
    37     public void test3()  throws OsmTransferException {
     37    public void testRelation()  throws OsmTransferException {
    3838        OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.RELATION,49);
    3939        HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java

    r7039 r7040  
    3030
    3131/**
    32  * Functional tests for Remote Control
     32 * Unit tests for Remote Control
    3333 */
    3434public class RemoteControlTest {
Note: See TracChangeset for help on using the changeset viewer.