Changeset 36140 in osm for applications/viewer
- Timestamp:
- 2023-09-18T14:36:02+02:00 (16 months ago)
- Location:
- applications/viewer/jmapviewer
- Files:
-
- 2 added
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/build.xml
r36139 r36140 1 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 <project default="all" name="jmapviewer" xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if" xmlns:unless="ant:unless"> 2 <project default="all" name="jmapviewer" 3 xmlns:jacoco="antlib:org.jacoco.ant" 4 xmlns:if="ant:if" 5 xmlns:ivy="antlib:org.apache.ivy.ant" 6 > 3 7 4 8 <property name="java.lang.version" value="8" /> … … 27 31 </condition> 28 32 <path id="test.classpath"> 29 <fileset dir="${tools.dir}/testlib">30 <include name="**/*.jar"/>31 </fileset>32 33 <pathelement location="bin"/> 33 34 </path> … … 80 81 </fileset> 81 82 </copy> 83 </target> 84 85 <target name="checkdepsupdate" depends="resolve"> 86 <ivy:checkdepsupdate/> 82 87 </target> 83 88 … … 132 137 </target> 133 138 134 <target name="checkstyle" >135 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" 136 classpath ="tools/checkstyle/checkstyle-all.jar"/>139 <target name="checkstyle" depends="resolve"> 140 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" 141 classpathref="checkstyle.classpath"/> 137 142 <checkstyle config="tools/checkstyle/jmapviewer_checks.xml"> 138 143 <!-- Exclude the module-info since checkstyle currently cannot parse it --> … … 142 147 </target> 143 148 144 <target name="spotbugs" depends="pack ">149 <target name="spotbugs" depends="pack,resolve"> 145 150 <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" 146 classpath="tools/spotbugs/spotbugs-ant.jar"/> 147 <path id="spotbugs-classpath"> 148 <fileset dir="tools/spotbugs/"> 149 <include name="*.jar"/> 150 </fileset> 151 </path> 152 <property name="spotbugs-classpath" refid="spotbugs-classpath"/> 151 classpathref="spotbugs.classpath"/> 152 <property name="spotbugs-classpath" refid="spotbugs.classpath"/> 153 153 <spotbugs output="xml" 154 154 outputFile="spotbugs-jmapviewer.xml" … … 178 178 </target> 179 179 180 <target name="test" depends="clean, build"> 181 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" /> 180 <target name="resolve" description="Resolve Ivy dependencies"> 181 <ivy:resolve/> 182 <ivy:cachepath pathid="checkstyle.classpath" conf="checkstyle"/> 183 <ivy:cachepath pathid="testlib.classpath" conf="test"/> 184 <ivy:cachepath pathid="jacoco.classpath" conf="jacocoant"/> 185 <ivy:cachepath pathid="spotbugs.classpath" conf="spotbugs"/> 186 </target> 187 188 <target name="test" depends="clean, build, resolve"> 189 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.classpath"/> 182 190 <javac srcdir="test" destdir="bintest" 183 191 target="${java.lang.version}" source="${java.lang.version}" debug="on" … … 186 194 <compilerarg value="-Xlint:-serial"/> 187 195 <classpath> 188 <path refid="test.classpath"/> 196 <path refid="testlib.classpath"/> 197 <path refid="test.classpath"/> 189 198 </classpath> 190 199 </javac> 191 <jacoco:coverage enabled="@{coverage}" includes="${jacoco.includes}" 192 inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}"> 193 <junit printsummary="yes" fork="true" forkmode="once"> 194 <jvmarg value="-Dfile.encoding=UTF-8"/> 195 <classpath> 196 <path refid="test.classpath"/> 197 <pathelement location="bintest"/> 198 </classpath> 199 <formatter type="plain"/> 200 <formatter type="xml"/> 201 <batchtest fork="yes" todir="report"> 202 <fileset dir="bintest" includes="**/*Test.class"/> 203 </batchtest> 204 </junit> 205 </jacoco:coverage> 200 <jacoco:agent enabled="@{coverage}" includes="${jacoco.includes}" 201 inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}" property="jacocoagent@{testfamily}@{testITsuffix}" if:true="@{coverage}"/> 202 <junitlauncher printsummary="yes"> 203 <classpath> 204 <path refid="testlib.classpath"/> 205 <path refid="test.classpath"/> 206 <pathelement location="bintest"/> 207 </classpath> 208 <testclasses outputdir="report"> 209 <fileset dir="bintest" includes="**/*Test.class"/> 210 <fork> 211 <jvmarg value="-Dfile.encoding=UTF-8"/> 212 </fork> 213 <listener type="legacy-brief" sendSysOut="true" sendSysErr="true"/> 214 <listener type="legacy-plain" /> 215 <listener type="legacy-xml" /> 216 </testclasses> 217 </junitlauncher> 206 218 </target> 207 219 -
applications/viewer/jmapviewer/test/org/openstreetmap/gui/jmapviewer/TileRangeTest.java
r34669 r36140 2 2 package org.openstreetmap.gui.jmapviewer; 3 3 4 import static org.junit.Assert.assertEquals;5 4 6 import org.junit.Test; 5 import static org.junit.jupiter.api.Assertions.assertEquals; 6 7 import org.junit.jupiter.api.Test; 7 8 8 9 /** 9 10 * Unit tests of {@link TileRange} class. 10 11 */ 11 publicclass TileRangeTest {12 class TileRangeTest { 12 13 13 14 /** … … 15 16 */ 16 17 @Test 17 publicvoid testSize() {18 void testSize() { 18 19 assertEquals(16, new TileRange( 19 20 new TileXY(3, 3), -
applications/viewer/jmapviewer/test/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSourceTest.java
r35527 r36140 2 2 package org.openstreetmap.gui.jmapviewer.tilesources; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.text.MessageFormat; … … 11 11 import java.util.stream.Stream; 12 12 13 import org.junit. Test;13 import org.junit.jupiter.api.Test; 14 14 15 15 /** … … 49 49 */ 50 50 @Test 51 publicvoid testGetTileUrl() {51 void testGetTileUrl() { 52 52 checkGetTileUrl( 53 53 "http://localhost/{z}/{x}/{y}", … … 61 61 */ 62 62 @Test 63 publicvoid testGetTileUrl_positive_zoom() {63 void testGetTileUrl_positive_zoom() { 64 64 checkGetTileUrl( 65 65 "http://localhost/{zoom+5}/{x}/{y}", … … 73 73 */ 74 74 @Test 75 publicvoid testGetTileUrl_negative_zoom() {75 void testGetTileUrl_negative_zoom() { 76 76 checkGetTileUrl( 77 77 "http://localhost/{zoom-5}/{x}/{y}", … … 85 85 */ 86 86 @Test 87 publicvoid testGetTileUrl_inverse_negative_zoom() {87 void testGetTileUrl_inverse_negative_zoom() { 88 88 checkGetTileUrl( 89 89 "http://localhost/{5-zoom}/{x}/{y}", … … 97 97 */ 98 98 @Test 99 publicvoid testGetTileUrl_both_offsets() {99 void testGetTileUrl_both_offsets() { 100 100 checkGetTileUrl( 101 101 "http://localhost/{10-zoom-5}/{x}/{y}", … … 109 109 */ 110 110 @Test 111 publicvoid testGetTileUrl_apiKey() {111 void testGetTileUrl_apiKey() { 112 112 System.setProperty("id1.api-key", "wololo"); 113 113 TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", "http://localhost/{zoom}/{x}/{y}?token={apikey}&foo=bar", "id1"); … … 120 120 */ 121 121 @Test 122 publicvoid testGetTileUrl_switch() {122 void testGetTileUrl_switch() { 123 123 TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", "http://{switch:a,b,c}.localhost/{10-zoom-5}/{x}/{y}", "id1"); 124 124 TemplatedTMSTileSource ts = new TemplatedTMSTileSource(testImageryTMS); … … 159 159 160 160 @Test 161 publicvoid testGetTileUrl_yahoo() {161 void testGetTileUrl_yahoo() { 162 162 checkGetTileUrl( 163 163 "http://localhost/{z}/{x}/{!y}", … … 169 169 170 170 @Test 171 publicvoid testGetTileUrl_negative_y() {171 void testGetTileUrl_negative_y() { 172 172 checkGetTileUrl( 173 173 "http://localhost/{z}/{x}/{-y}", … … 189 189 */ 190 190 @Test 191 publicvoid testAllUrls() {191 void testAllUrls() { 192 192 for (String[] test: TEST_DATA) { 193 193 TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", test[0], "id1");
Note:
See TracChangeset
for help on using the changeset viewer.