Remove MapTiler dependency Instrumentation Tests (#2438)

This commit is contained in:
Bart Louwers
2024-06-11 19:01:30 +02:00
committed by GitHub
parent de4dd0bb03
commit 7437d800f6
102 changed files with 305 additions and 181 deletions

View File

@@ -4,6 +4,7 @@ import androidx.test.filters.LargeTest
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import androidx.test.rule.ActivityTestRule
import androidx.test.uiautomator.UiSelector
import org.junit.Ignore
import org.maplibre.android.testapp.activity.fragment.FragmentBackStackActivity
import org.junit.Rule
import org.junit.Test
@@ -19,6 +20,7 @@ class FragmentBackStackTest : BaseIntegrationTest() {
var activityRule: ActivityTestRule<FragmentBackStackActivity> = ActivityTestRule(FragmentBackStackActivity::class.java)
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2469")
@LargeTest
fun backPressedOnBackStackResumed() {
device.waitForIdle()

View File

@@ -3,6 +3,7 @@ package org.maplibre.android.integration
import androidx.test.filters.LargeTest
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import androidx.test.rule.ActivityTestRule
import org.junit.Ignore
import org.maplibre.android.testapp.activity.textureview.TextureViewDebugModeActivity
import org.junit.Rule
import org.junit.Test

View File

@@ -3,6 +3,7 @@ package org.maplibre.android.integration
import androidx.test.filters.LargeTest
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import androidx.test.rule.ActivityTestRule
import org.junit.Ignore
import org.maplibre.android.testapp.activity.maplayout.TextureRecyclerViewActivity
import org.junit.Rule
import org.junit.Test

View File

@@ -35,6 +35,7 @@ import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.runner.RunWith
import org.maplibre.android.testapp.styles.TestStyles
@RunWith(AndroidJUnit4ClassRunner::class)
class LocationComponentTest : EspressoTest() {
@@ -191,7 +192,7 @@ class LocationComponentTest : EspressoTest() {
uiController: UiController,
context: Context
) {
maplibreMap.setStyle(Style.Builder().fromUrl(Style.getPredefinedStyle("Bright")))
maplibreMap.setStyle(Style.Builder().fromUrl(TestStyles.getPredefinedStyleWithFallback("Bright")))
component.activateLocationComponent(
LocationComponentActivationOptions
@@ -676,7 +677,7 @@ class LocationComponentTest : EspressoTest() {
component.isLocationComponentEnabled = true
component.forceLocationUpdate(location)
component.isLocationComponentEnabled = false
maplibreMap.setStyle(Style.Builder().fromUrl(Style.getPredefinedStyle("Bright")))
maplibreMap.setStyle(Style.Builder().fromUrl(TestStyles.getPredefinedStyleWithFallback("Bright")))
component.isLocationComponentEnabled = true
TestingAsyncUtils.waitForLayer(uiController, mapView)
@@ -797,7 +798,7 @@ class LocationComponentTest : EspressoTest() {
component.onStop()
component.onStart()
maplibreMap.setStyle(Style.Builder().fromUrl(Style.getPredefinedStyle("Bright")))
maplibreMap.setStyle(Style.Builder().fromUri(TestStyles.getPredefinedStyleWithFallback("Bright")))
TestingAsyncUtils.waitForLayer(uiController, mapView)
}
}
@@ -822,7 +823,7 @@ class LocationComponentTest : EspressoTest() {
.build()
)
component.isLocationComponentEnabled = true
maplibreMap.setStyle(Style.Builder().fromUrl(Style.getPredefinedStyle("Bright")))
maplibreMap.setStyle(Style.Builder().fromUrl(TestStyles.getPredefinedStyleWithFallback("Bright")))
component.onStop()
component.onStart()
TestingAsyncUtils.waitForLayer(uiController, mapView)
@@ -909,7 +910,7 @@ class LocationComponentTest : EspressoTest() {
)
component.isLocationComponentEnabled = true
component.forceLocationUpdate(location)
maplibreMap.setStyle(Style.Builder().fromUrl(Style.getPredefinedStyle("Bright")))
maplibreMap.setStyle(Style.Builder().fromUrl(TestStyles.getPredefinedStyleWithFallback("Bright")))
component.onStop()
TestingAsyncUtils.waitForLayer(uiController, mapView)
component.onStart()

View File

@@ -38,6 +38,7 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.maplibre.android.testapp.styles.TestStyles
import kotlin.math.abs
@RunWith(AndroidJUnit4ClassRunner::class)
@@ -154,7 +155,7 @@ class LocationLayerControllerTest : EspressoTest() {
component.isLocationComponentEnabled = true
component.renderMode = RenderMode.NORMAL
component.forceLocationUpdate(location)
styleChangeIdlingResource.waitForStyle(maplibreMap, Style.getPredefinedStyle("Bright"))
styleChangeIdlingResource.waitForStyle(maplibreMap, TestStyles.getPredefinedStyleWithFallback("Bright"))
TestingAsyncUtils.waitForLayer(uiController, mapView)
assertThat(component.renderMode, `is`(equalTo(RenderMode.NORMAL)))
@@ -456,7 +457,7 @@ class LocationLayerControllerTest : EspressoTest() {
component.isLocationComponentEnabled = true
component.renderMode = RenderMode.NORMAL
component.forceLocationUpdate(location)
styleChangeIdlingResource.waitForStyle(maplibreMap, Style.getPredefinedStyle("Bright"))
styleChangeIdlingResource.waitForStyle(maplibreMap, TestStyles.getPredefinedStyleWithFallback("Bright"))
TestingAsyncUtils.waitForLayer(uiController, mapView)
assertThat(component.renderMode, `is`(equalTo(RenderMode.NORMAL)))
@@ -503,7 +504,7 @@ class LocationLayerControllerTest : EspressoTest() {
`is`(true)
)
maplibreMap.setStyle(Style.Builder().fromUrl(Style.getPredefinedStyle("Bright")))
maplibreMap.setStyle(Style.Builder().fromUrl(TestStyles.getPredefinedStyleWithFallback("Bright")))
TestingAsyncUtils.waitForLayer(uiController, mapView)
assertThat(

View File

@@ -21,6 +21,7 @@ import org.junit.Assert.*
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.maplibre.android.testapp.styles.TestStyles
@RunWith(AndroidJUnit4ClassRunner::class)
class NativeMapViewTest : AppCenter() {
@@ -61,7 +62,7 @@ class NativeMapViewTest : AppCenter() {
@Test
@UiThreadTest
fun testSetStyleUrl() {
val expected = Style.getPredefinedStyle("Pastel")
val expected = TestStyles.getPredefinedStyleWithFallback("Pastel")
nativeMapView.styleUri = expected
val actual = nativeMapView.styleUri
assertEquals("Style URL should match", expected, actual)

View File

@@ -10,8 +10,10 @@ import org.maplibre.android.testapp.activity.BaseTest
import org.maplibre.android.testapp.activity.espresso.PixelTestActivity
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Ignore
import org.junit.Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2468")
class VisibleRegionTest : BaseTest() {
override fun getActivityClass(): Class<*> {

View File

@@ -5,11 +5,11 @@ import androidx.test.rule.ActivityTestRule
import org.junit.Ignore
import org.maplibre.geojson.Point
import org.maplibre.android.log.Logger
import org.maplibre.android.maps.Style
import org.maplibre.android.testapp.activity.FeatureOverviewActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.maplibre.android.testapp.styles.TestStyles
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
@@ -71,7 +71,7 @@ class OfflineDownloadTest : OfflineRegion.OfflineRegionObserver {
private fun createTestRegionDefinition(): OfflineRegionDefinition {
return OfflineGeometryRegionDefinition(
Style.getPredefinedStyle("Streets"),
TestStyles.getPredefinedStyleWithFallback("Streets"),
Point.fromLngLat(50.847857, 4.360137),
17.0,
17.0,

View File

@@ -14,6 +14,7 @@ import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.maplibre.android.testapp.styles.TestStyles
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
@@ -40,7 +41,7 @@ class MapSnapshotterTest {
val options = MapSnapshotter.Options(512, 512)
.withPixelRatio(1.0f)
.withStyleBuilder(
Style.Builder().fromUri(Style.getPredefinedStyle("Satellite Hybrid"))
Style.Builder().fromUri(TestStyles.getPredefinedStyleWithFallback("Satellite Hybrid"))
.withLayerAbove(bg, "country-label")
)
.withCameraPosition(

View File

@@ -4,6 +4,7 @@ import androidx.annotation.UiThread
import org.maplibre.android.maps.MapLibreMap
import org.maplibre.android.maps.Style
import org.maplibre.android.testapp.activity.espresso.EspressoTestActivity
import org.maplibre.android.testapp.styles.TestStyles
/**
* Base class for all tests using EspressoTestActivity as wrapper.
@@ -19,7 +20,7 @@ open class EspressoTest : BaseTest() {
@UiThread
override fun initMap(maplibreMap: MapLibreMap) {
maplibreMap.setStyle(Style.Builder().fromUri("asset://streets.json"))
maplibreMap.setStyle(Style.Builder().fromUri(TestStyles.VERSATILES))
super.initMap(maplibreMap)
}
}

View File

@@ -138,7 +138,7 @@ public class GeoJsonConversionTest extends EspressoTest {
SymbolLayer layer = new SymbolLayer("layer", "source")
.withProperties(
PropertyFactory.iconOffset(Expression.get("property")),
PropertyFactory.iconImage("zoo-15")
PropertyFactory.iconImage("icon-zoo")
);
maplibreMap.getStyle().addLayer(layer);

View File

@@ -71,8 +71,8 @@ class ImageMissingTest : AppCenter() {
{
"version": 8,
"name": "Streets",
"sprite": "maptiler://sprites/streets/sprite",
"glyphs": "maptiler://fonts/{fontstack}/{range}.pbf",
"sprite": "https://maputnik.github.io/osm-liberty/sprites/osm-liberty",
"glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
"sources": {
"point": {
"type": "geojson",
@@ -115,8 +115,8 @@ class ImageMissingTest : AppCenter() {
{
"version": 8,
"name": "Streets",
"sprite": "maptiler://sprites/streets/sprite",
"glyphs": "maptiler://fonts/{fontstack}/{range}.pbf",
"sprite": "https://maputnik.github.io/osm-liberty/sprites/osm-liberty",
"glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
"sources": {
"point": {
"type": "geojson",

View File

@@ -1,5 +1,6 @@
package org.maplibre.android.testapp.style;
import org.junit.Ignore;
import org.maplibre.geojson.Feature;
import org.maplibre.geojson.Point;
import org.maplibre.android.geometry.LatLng;
@@ -286,6 +287,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testConstFormatExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -309,6 +311,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testConstFormatExpressionFontScaleParam() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -332,6 +335,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testConstFormatExpressionTextFontParam() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -362,6 +366,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testConstFormatExpressionTextColorParam() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -391,6 +396,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testConstFormatExpressionAllParams() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -425,6 +431,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testConstFormatExpressionMultipleInputs() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -462,6 +469,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testVariableFormatExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -493,6 +501,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testVariableFormatExpressionMultipleInputs() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -525,6 +534,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testFormatExpressionPlainTextCoercion() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -546,6 +556,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testTextFieldFormattedArgument() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -572,6 +583,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testNumberFormatCurrencyExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -597,6 +609,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testNumberFormatMaxExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -622,6 +635,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testNumberFormatMinExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -647,6 +661,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testNumberFormatLocaleExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {
@@ -673,6 +688,7 @@ public class ExpressionTest extends EspressoTest {
}
@Test
@Ignore("https://github.com/maplibre/maplibre-native/issues/2437")
public void testNumberFormatNonConstantExpression() {
validateTestSetup();
invoke(maplibreMap, (uiController, maplibreMap) -> {