summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-07-19 12:08:21 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-07-20 12:35:00 -0700
commit579328314285dd03f5d4e31c4d16b4741ed7ac09 (patch)
tree6c9e9ffdb3736dd2200d3b5fe9faab515c21948d /platform
parent2c5d0e74a1ef6743a23dbd346b79958e4b2f8614 (diff)
downloadqtlocation-mapboxgl-579328314285dd03f5d4e31c4d16b4741ed7ac09.tar.gz
[android] Test token strings for icon-image and text-field
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java6
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs5
2 files changed, 11 insertions, 0 deletions
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 fe38fef253..1a5d4ebc2b 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
@@ -272,6 +272,9 @@ public class SymbolLayerTest extends BaseActivityTest {
// Set and Get
layer.setProperties(iconImage("undefined"));
assertEquals((String) layer.getIconImage().getValue(), (String) "undefined");
+
+ layer.setProperties(iconImage("{token}"));
+ assertEquals(layer.getIconImage().getExpression(), Expression.toString(Expression.get("token")));
});
}
@@ -446,6 +449,9 @@ public class SymbolLayerTest extends BaseActivityTest {
// Set and Get
layer.setProperties(textField(""));
assertEquals((String) layer.getTextField().getValue(), (String) "");
+
+ layer.setProperties(textField("{token}"));
+ assertEquals(layer.getTextField().getExpression(), Expression.toString(Expression.get("token")));
});
}
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 575f64e809..8acfc88dfa 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
@@ -148,6 +148,11 @@ public class <%- camelize(type) %>LayerTest extends BaseActivityTest {
// Set and Get
layer.setProperties(<%- camelizeWithLeadingLowercase(property.name) %>(<%- defaultValueJava(property) %>));
assertEquals((<%- propertyType(property) %>) layer.get<%- camelize(property.name) %>().getValue(), (<%- propertyType(property) %>) <%- defaultValueJava(property) %>);
+<% if (property.tokens) { -%>
+
+ layer.setProperties(<%- camelizeWithLeadingLowercase(property.name) %>("{token}"));
+ assertEquals(layer.get<%- camelize(property.name) %>().getExpression(), Expression.toString(Expression.get("token")));
+<% } -%>
});
}
<% if (property['property-type'] === 'data-driven' || property['property-type'] === 'cross-faded-data-driven') { -%>