Permalink
Browse files

#794 fixes junit compile error and enables unit tests on travis

  • Loading branch information...
spyhunter99 committed Dec 2, 2017
1 parent 306ccce commit a69ab618375af387f6fc53231de3f83d6120e83a
View
@@ -124,7 +124,7 @@ script:
- ./gradlew -version
- echo $JAVA_HOME
- export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- travis_wait 60 ./gradlew clean connectedCheck
- travis_wait 60 ./gradlew clean install connectedCheck
# fun fact, maven runs android tests concurrently for all connected devices, gradle does not
# since we're using build matrix, each build target compiles the source, fires up it's specific vm, runs the tests, then exits.
# --stacktrace
@@ -1,7 +1,7 @@
description = 'Example application for 3rd party utilities, including the Google wrapper sample, Bing map sources, etc'
apply plugin: 'com.android.application'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
@@ -1,7 +1,7 @@
description = 'OpenMap in the Play Store, the example app for using osmdroid'
apply plugin: 'com.android.application'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {
defaultConfig {
View
@@ -21,7 +21,7 @@ allprojects {
project.version =
( project.hasProperty('pom.version') ? project.property('pom.version') : "1.0" )
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/maven-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/maven-support.gradle"
// forces all changing dependencies (i.e. SNAPSHOTs) to automagicially download
// (thanks, @BillBarnhill!)
@@ -50,9 +50,9 @@ allprojects {
}
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/encryption.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/encryption.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/site.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/site.gradle"
//copy the readme into the site folder as the index
@@ -1,6 +1,6 @@
description = 'An Android library to display OpenStreetMap views.'
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {
lintOptions {
@@ -228,7 +228,7 @@ private Projection getRandomProjection(
pGeoPoint,
pOffsetX, pOffsetY,
getRandomOrientation(),
mScale, new PointF(mWidth / 2, mHeight / 2), true);
mScale, new PointF(mWidth / 2, mHeight / 2), true, true);
}
private Projection getRandomProjection(final double pZoomLevel) {
@@ -19,17 +19,17 @@
@Test
public void testGetY01FromLatitude() {
checkXY01(0, TileSystem.getY01FromLatitude(TileSystem.MaxLatitude));
checkXY01(.5, TileSystem.getY01FromLatitude(0));
checkXY01(1, TileSystem.getY01FromLatitude(TileSystem.MinLatitude));
checkXY01(0, TileSystem.getY01FromLatitude(TileSystem.MaxLatitude, true));
checkXY01(.5, TileSystem.getY01FromLatitude(0, true));
checkXY01(1, TileSystem.getY01FromLatitude(TileSystem.MinLatitude, true));
}
@Test
public void testGetX01FromLongitude() {
final int iterations = 10;
for (int i = 0 ; i <= iterations ; i ++) {
final double longitude = TileSystem.MinLongitude + i * (TileSystem.MaxLongitude - TileSystem.MinLongitude) / iterations;
checkXY01(((double)i) / iterations, TileSystem.getX01FromLongitude(longitude));
checkXY01(((double)i) / iterations, TileSystem.getX01FromLongitude(longitude, true));
}
}
@@ -38,9 +38,9 @@ public void testGetX01FromLongitude() {
*/
@Test
public void testGetLatitudeFromY01() {
checkLatitude(TileSystem.MaxLatitude, TileSystem.getLatitudeFromY01(0));
checkLatitude(0, TileSystem.getLatitudeFromY01(0.5));
checkLatitude(TileSystem.MinLatitude, TileSystem.getLatitudeFromY01(1));
checkLatitude(TileSystem.MaxLatitude, TileSystem.getLatitudeFromY01(0, true));
checkLatitude(0, TileSystem.getLatitudeFromY01(0.5, true));
checkLatitude(TileSystem.MinLatitude, TileSystem.getLatitudeFromY01(1, true));
}
/**
@@ -51,7 +51,7 @@ public void testLatitude() {
final int iterations = 100;
for (int i = 0 ; i <= iterations ; i ++) {
final double latitude = getRandomLatitude();
checkLatitude(latitude, TileSystem.getLatitudeFromY01(TileSystem.getY01FromLatitude(latitude)));
checkLatitude(latitude, TileSystem.getLatitudeFromY01(TileSystem.getY01FromLatitude(latitude, true), true));
}
}
@@ -63,11 +63,11 @@ public void testGetLongitudeFromX01() {
final int iterations = 10;
for (int i = 0 ; i <= iterations ; i ++) {
final double longitude = TileSystem.MinLongitude + i * (TileSystem.MaxLongitude - TileSystem.MinLongitude) / iterations;
checkLongitude(longitude, TileSystem.getLongitudeFromX01(((double)i) / iterations));
checkLongitude(longitude, TileSystem.getLongitudeFromX01(((double)i) / iterations, true));
}
checkLongitude(TileSystem.MinLongitude, TileSystem.getLongitudeFromX01(0));
checkLongitude(0, TileSystem.getLongitudeFromX01(0.5));
checkLongitude(TileSystem.MaxLongitude, TileSystem.getLongitudeFromX01(1));
checkLongitude(TileSystem.MinLongitude, TileSystem.getLongitudeFromX01(0, true));
checkLongitude(0, TileSystem.getLongitudeFromX01(0.5, true));
checkLongitude(TileSystem.MaxLongitude, TileSystem.getLongitudeFromX01(1, true));
}
/**
@@ -78,7 +78,7 @@ public void testLongitude() {
final int iterations = 100;
for (int i = 0 ; i <= iterations ; i ++) {
final double longitude = getRandomLongitude();
checkLongitude(longitude, TileSystem.getLongitudeFromX01(TileSystem.getX01FromLongitude(longitude)));
checkLongitude(longitude, TileSystem.getLongitudeFromX01(TileSystem.getX01FromLongitude(longitude, true), true));
}
}
@@ -131,10 +131,10 @@ public void testGetBoundingBoxZoom() throws Exception{
continue;
}
final double mapSize = TileSystem.MapSize(zoom);
final long left = TileSystem.getMercatorXFromLongitude(west, mapSize);
final long top = TileSystem.getMercatorYFromLatitude(north, mapSize);
final long right = TileSystem.getMercatorXFromLongitude(east, mapSize);
final long bottom = TileSystem.getMercatorYFromLatitude(south, mapSize);
final long left = TileSystem.getMercatorXFromLongitude(west, mapSize, true);
final long top = TileSystem.getMercatorYFromLatitude(north, mapSize, true);
final long right = TileSystem.getMercatorXFromLongitude(east, mapSize, true);
final long bottom = TileSystem.getMercatorYFromLatitude(south, mapSize, true);
long width = right - left;
if (east < west) {
width += mapSize;
@@ -1,7 +1,7 @@
description = 'Geopackage support for osmdroid'
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {
@@ -1,6 +1,6 @@
description = "An Android library to display OpenStreetMap views using Mapsforge. May use non ASF licensed dependencies"
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {
defaultConfig {
@@ -1,6 +1,6 @@
description = 'osmdroid 3rd party libraries and examples. May use non ASF licensed libraries as dependencies'
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {
compileSdkVersion "Google Inc.:Google APIs:23"
buildToolsVersion "23.0.3"
@@ -1,6 +1,6 @@
description = 'OSMdroid Android WMS Client'
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.3/gradle/android-support.gradle"
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"
android {

0 comments on commit a69ab61

Please sign in to comment.