Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 24de48b

Browse files
committed
[android] - update android unit tests, update test make target to SDK
1 parent 4d486e1 commit 24de48b

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,9 @@ run-android-ui-test-%: run-android-ui-test-arm-v7-%
595595
# Run Java Unit tests on the JVM of the development machine executing this
596596
.PHONY: run-android-unit-test
597597
run-android-unit-test: platform/android/configuration.gradle
598-
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDKTestApp:testDebugUnitTest
598+
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest
599599
run-android-unit-test-%: platform/android/configuration.gradle
600-
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDKTestApp:testDebugUnitTest --tests "$*"
600+
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --tests "$*"
601601

602602
# Run Instrumentation tests on AWS device farm, requires additional authentication through gradle.properties
603603
.PHONY: run-android-ui-test-aws
@@ -654,7 +654,7 @@ android-lint-test-app: platform/android/configuration.gradle
654654
android-javadoc: platform/android/configuration.gradle
655655
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:javadocrelease
656656

657-
# Symbolicate ndk stack traces for the arm-v7 abi
657+
# Symbolicate ndk stack traces for the arm-v7 abi
658658
.PHONY: android-ndk-stack
659659
android-ndk-stack: android-ndk-stack-arm-v7
660660

platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java

-9
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@ public void center() {
7373
assertEquals("Center should match", new LatLng(1, 1), center);
7474
}
7575

76-
@Test
77-
public void emptySpan() {
78-
latLngBounds = new LatLngBounds.Builder()
79-
.include(LAT_LNG_NOT_NULL_ISLAND)
80-
.include(LAT_LNG_NOT_NULL_ISLAND)
81-
.build();
82-
assertTrue("Should be empty", latLngBounds.isEmptySpan());
83-
}
84-
8576
@Test
8677
public void notEmptySpan() {
8778
latLngBounds = new LatLngBounds.Builder()

platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/AnnotationManagerTest.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.mapbox.mapboxsdk.geometry.LatLng;
1111

1212
import org.junit.Test;
13+
import org.mockito.ArgumentMatchers;
1314

1415
import java.util.ArrayList;
1516
import java.util.List;
@@ -32,8 +33,9 @@ public void checksAddAMarker() throws Exception {
3233
Markers markers = new MarkerContainer(aNativeMapView, aMapView, annotationsArray, aIconManager, aMarkerViewManager);
3334
Polygons polygons = new PolygonContainer(aNativeMapView, annotationsArray);
3435
Polylines polylines = new PolylineContainer(aNativeMapView, annotationsArray);
36+
ShapeAnnotations shapeAnnotations = new ShapeAnnotationContainer(aNativeMapView, annotationsArray);
3537
AnnotationManager annotationManager = new AnnotationManager(aNativeMapView, aMapView, annotationsArray,
36-
aMarkerViewManager, aIconManager, annotations, markers, polygons, polylines);
38+
aMarkerViewManager, aIconManager, annotations, markers, polygons, polylines, shapeAnnotations);
3739
Marker aMarker = mock(Marker.class);
3840
long aId = 5L;
3941
when(aNativeMapView.addMarker(aMarker)).thenReturn(aId);
@@ -58,18 +60,23 @@ public void checksAddMarkers() throws Exception {
5860
Markers markers = new MarkerContainer(aNativeMapView, aMapView, annotationsArray, aIconManager, aMarkerViewManager);
5961
Polygons polygons = new PolygonContainer(aNativeMapView, annotationsArray);
6062
Polylines polylines = new PolylineContainer(aNativeMapView, annotationsArray);
63+
ShapeAnnotations shapeAnnotations = new ShapeAnnotationContainer(aNativeMapView, annotationsArray);
6164
AnnotationManager annotationManager = new AnnotationManager(aNativeMapView, aMapView, annotationsArray,
62-
aMarkerViewManager, aIconManager, annotations, markers, polygons, polylines);
65+
aMarkerViewManager, aIconManager, annotations, markers, polygons, polylines, shapeAnnotations);
6366
long firstId = 1L;
6467
long secondId = 2L;
6568
List<BaseMarkerOptions> markerList = new ArrayList<>();
6669
MarkerOptions firstMarkerOption = new MarkerOptions().position(new LatLng()).title("first");
6770
MarkerOptions secondMarkerOption = new MarkerOptions().position(new LatLng()).title("second");
71+
6872
markerList.add(firstMarkerOption);
6973
markerList.add(secondMarkerOption);
7074
MapboxMap aMapboxMap = mock(MapboxMap.class);
7175
when(aNativeMapView.addMarker(any(Marker.class))).thenReturn(firstId, secondId);
7276

77+
when(aNativeMapView.addMarkers(ArgumentMatchers.<Marker>anyList()))
78+
.thenReturn(new long[]{firstId, secondId});
79+
7380
annotationManager.addMarkers(markerList, aMapboxMap);
7481

7582
assertEquals(2, annotationManager.getAnnotations().size());

0 commit comments

Comments
 (0)