diff options
author | Tobrun <tobrun@mapbox.com> | 2017-04-19 15:05:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 15:05:08 +0200 |
commit | 553ec88dc0350b9b034a0370300653d94f092382 (patch) | |
tree | 291aaa4e26979090a5b233d69e9cba557f0ab5f2 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java | |
parent | 9c1150cfe9c1d7c4992e421695ce7c83a4840339 (diff) | |
download | qtlocation-mapboxgl-553ec88dc0350b9b034a0370300653d94f092382.tar.gz |
[android] - expose source layer identifier (#8709)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java')
7 files changed, 74 insertions, 49 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/BackgroundLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/BackgroundLayerTest.java index 4f94dcc28b..ef73dc7850 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/BackgroundLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/BackgroundLayerTest.java @@ -234,7 +234,6 @@ public class BackgroundLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getBackgroundOpacity().getFunction().getStops()).size()); } - @After public void unregisterIntentServiceIdlingResource() { Espresso.unregisterIdlingResources(idlingResource); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/CircleLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/CircleLayerTest.java index 7b8a03fb35..11843ce28f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/CircleLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/CircleLayerTest.java @@ -84,6 +84,21 @@ public class CircleLayerTest extends BaseStyleTest { } @Test + public void testSourceLayer() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("Visibility"); + assertNotNull(layer); + + // Get initial + assertEquals(layer.getSourceLayer(), "composite"); + + // Set + final String sourceLayer = "test"; + layer.setSourceLayer(sourceLayer); + assertEquals(layer.getSourceLayer(), sourceLayer); + } + + @Test public void testCircleRadiusTransition() { checkViewIsDisplayed(R.id.mapView); Timber.i("circle-radiusTransitionOptions"); @@ -737,7 +752,6 @@ public class CircleLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getCircleTranslate().getFunction().getStops()).size()); } - @Test public void testCircleTranslateAnchorAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -774,7 +788,6 @@ public class CircleLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getCircleTranslateAnchor().getFunction().getStops()).size()); } - @Test public void testCirclePitchScaleAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1259,7 +1272,6 @@ public class CircleLayerTest extends BaseStyleTest { assertEquals(0.9f, stop.out, 0.001f); } - @After public void unregisterIntentServiceIdlingResource() { Espresso.unregisterIdlingResources(idlingResource); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/FillLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/FillLayerTest.java index 63dac76edd..edbfcb1106 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/FillLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/FillLayerTest.java @@ -83,6 +83,20 @@ public class FillLayerTest extends BaseStyleTest { assertEquals(layer.getVisibility().getValue(), NONE); } + @Test + public void testSourceLayer() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("Visibility"); + assertNotNull(layer); + + // Get initial + assertEquals(layer.getSourceLayer(), "composite"); + + // Set + final String sourceLayer = "test"; + layer.setSourceLayer(sourceLayer); + assertEquals(layer.getSourceLayer(), sourceLayer); + } @Test public void testFillAntialiasAsConstant() { @@ -594,7 +608,6 @@ public class FillLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getFillTranslate().getFunction().getStops()).size()); } - @Test public void testFillTranslateAnchorAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -679,7 +692,6 @@ public class FillLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getFillPattern().getFunction().getStops()).size()); } - @After public void unregisterIntentServiceIdlingResource() { Espresso.unregisterIdlingResources(idlingResource); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LineLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LineLayerTest.java index 110d23dd90..7263b5de73 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LineLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LineLayerTest.java @@ -83,6 +83,20 @@ public class LineLayerTest extends BaseStyleTest { assertEquals(layer.getVisibility().getValue(), NONE); } + @Test + public void testSourceLayer() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("Visibility"); + assertNotNull(layer); + + // Get initial + assertEquals(layer.getSourceLayer(), "composite"); + + // Set + final String sourceLayer = "test"; + layer.setSourceLayer(sourceLayer); + assertEquals(layer.getSourceLayer(), sourceLayer); + } @Test public void testLineCapAsConstant() { @@ -120,7 +134,6 @@ public class LineLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getLineCap().getFunction().getStops()).size()); } - @Test public void testLineJoinAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -157,7 +170,6 @@ public class LineLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getLineJoin().getFunction().getStops()).size()); } - @Test public void testLineMiterLimitAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -195,7 +207,6 @@ public class LineLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getLineMiterLimit().getFunction().getStops()).size()); } - @Test public void testLineRoundLimitAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -573,7 +584,6 @@ public class LineLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getLineTranslate().getFunction().getStops()).size()); } - @Test public void testLineTranslateAnchorAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1226,7 +1236,6 @@ public class LineLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getLinePattern().getFunction().getStops()).size()); } - @After public void unregisterIntentServiceIdlingResource() { Espresso.unregisterIdlingResources(idlingResource); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RasterLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RasterLayerTest.java index 2d902a7432..8ff3911cd1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RasterLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RasterLayerTest.java @@ -426,7 +426,6 @@ public class RasterLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getRasterFadeDuration().getFunction().getStops()).size()); } - @After public void unregisterIntentServiceIdlingResource() { Espresso.unregisterIdlingResources(idlingResource); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java index d81965f2c9..97fc3e07d3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java @@ -83,6 +83,20 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(layer.getVisibility().getValue(), NONE); } + @Test + public void testSourceLayer() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("Visibility"); + assertNotNull(layer); + + // Get initial + assertEquals(layer.getSourceLayer(), "composite"); + + // Set + final String sourceLayer = "test"; + layer.setSourceLayer(sourceLayer); + assertEquals(layer.getSourceLayer(), sourceLayer); + } @Test public void testSymbolPlacementAsConstant() { @@ -120,7 +134,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getSymbolPlacement().getFunction().getStops()).size()); } - @Test public void testSymbolSpacingAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -158,7 +171,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getSymbolSpacing().getFunction().getStops()).size()); } - @Test public void testSymbolAvoidEdgesAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -195,7 +207,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getSymbolAvoidEdges().getFunction().getStops()).size()); } - @Test public void testIconAllowOverlapAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -232,7 +243,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconAllowOverlap().getFunction().getStops()).size()); } - @Test public void testIconIgnorePlacementAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -269,7 +279,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconIgnorePlacement().getFunction().getStops()).size()); } - @Test public void testIconOptionalAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -306,7 +315,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconOptional().getFunction().getStops()).size()); } - @Test public void testIconRotationAlignmentAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -343,7 +351,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconRotationAlignment().getFunction().getStops()).size()); } - @Test public void testIconSizeAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -381,7 +388,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getIconSize().getFunction().getStops()).size()); } - @Test public void testIconSizeAsIdentitySourceFunction() { checkViewIsDisplayed(R.id.mapView); @@ -526,7 +532,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconTextFit().getFunction().getStops()).size()); } - @Test public void testIconTextFitPaddingAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -564,7 +569,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getIconTextFitPadding().getFunction().getStops()).size()); } - @Test public void testIconImageAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -601,7 +605,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconImage().getFunction().getStops()).size()); } - @Test public void testIconImageAsIdentitySourceFunction() { checkViewIsDisplayed(R.id.mapView); @@ -792,7 +795,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(0.9f, stop.out, 0.001f); } - @Test public void testIconPaddingAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -830,7 +832,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getIconPadding().getFunction().getStops()).size()); } - @Test public void testIconKeepUprightAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -867,7 +868,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getIconKeepUpright().getFunction().getStops()).size()); } - @Test public void testIconOffsetAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -950,7 +950,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(IntervalStops.class, layer.getIconOffset().getFunction().getStops().getClass()); } - @Test public void testTextPitchAlignmentAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -987,7 +986,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextPitchAlignment().getFunction().getStops()).size()); } - @Test public void testTextRotationAlignmentAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1024,7 +1022,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextRotationAlignment().getFunction().getStops()).size()); } - @Test public void testTextFieldAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1106,7 +1103,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(IntervalStops.class, layer.getTextField().getFunction().getStops().getClass()); } - @Test public void testTextFontAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1143,7 +1139,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextFont().getFunction().getStops()).size()); } - @Test public void testTextSizeAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1181,7 +1176,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextSize().getFunction().getStops()).size()); } - @Test public void testTextSizeAsIdentitySourceFunction() { checkViewIsDisplayed(R.id.mapView); @@ -1327,7 +1321,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextMaxWidth().getFunction().getStops()).size()); } - @Test public void testTextLineHeightAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1365,7 +1358,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextLineHeight().getFunction().getStops()).size()); } - @Test public void testTextLetterSpacingAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1403,7 +1395,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextLetterSpacing().getFunction().getStops()).size()); } - @Test public void testTextJustifyAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1440,7 +1431,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextJustify().getFunction().getStops()).size()); } - @Test public void testTextAnchorAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1477,7 +1467,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextAnchor().getFunction().getStops()).size()); } - @Test public void testTextMaxAngleAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1515,7 +1504,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextMaxAngle().getFunction().getStops()).size()); } - @Test public void testTextRotateAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1553,7 +1541,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextRotate().getFunction().getStops()).size()); } - @Test public void testTextRotateAsIdentitySourceFunction() { checkViewIsDisplayed(R.id.mapView); @@ -1699,7 +1686,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextPadding().getFunction().getStops()).size()); } - @Test public void testTextKeepUprightAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1736,7 +1722,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextKeepUpright().getFunction().getStops()).size()); } - @Test public void testTextTransformAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1818,7 +1803,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(IntervalStops.class, layer.getTextTransform().getFunction().getStops().getClass()); } - @Test public void testTextOffsetAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1901,7 +1885,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(IntervalStops.class, layer.getTextOffset().getFunction().getStops().getClass()); } - @Test public void testTextAllowOverlapAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1938,7 +1921,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextAllowOverlap().getFunction().getStops()).size()); } - @Test public void testTextIgnorePlacementAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -1975,7 +1957,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextIgnorePlacement().getFunction().getStops()).size()); } - @Test public void testTextOptionalAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -2800,7 +2781,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getIconTranslate().getFunction().getStops()).size()); } - @Test public void testIconTranslateAnchorAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -3625,7 +3605,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((ExponentialStops) layer.getTextTranslate().getFunction().getStops()).size()); } - @Test public void testTextTranslateAnchorAsConstant() { checkViewIsDisplayed(R.id.mapView); @@ -3662,7 +3641,6 @@ public class SymbolLayerTest extends BaseStyleTest { assertEquals(1, ((IntervalStops) layer.getTextTranslateAnchor().getFunction().getStops()).size()); } - @After public void unregisterIntentServiceIdlingResource() { Espresso.unregisterIdlingResources(idlingResource); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs index 8aa0f15954..fd0c177fb8 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs @@ -91,9 +91,26 @@ public class <%- camelize(type) %>LayerTest extends BaseStyleTest { layer.setProperties(visibility(NONE)); assertEquals(layer.getVisibility().getValue(), NONE); } +<% if (!(type === 'background' || type === 'raster')) { -%> + @Test + public void testSourceLayer() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("Visibility"); + assertNotNull(layer); + + // Get initial + assertEquals(layer.getSourceLayer(), "composite"); + + // Set + final String sourceLayer = "test"; + layer.setSourceLayer(sourceLayer); + assertEquals(layer.getSourceLayer(), sourceLayer); + } +<% } -%> <% for (const property of properties) { -%> <% if (property.transition) { -%> + @Test public void test<%- camelize(property.name) %>Transition() { checkViewIsDisplayed(R.id.mapView); @@ -363,7 +380,6 @@ public class <%- camelize(type) %>LayerTest extends BaseStyleTest { assertEquals(layer.get<%- camelize(property.name) %>AsInt(), Color.RED); } <% } -%> - <% } -%> @After |