[android] Test token strings for icon-image and text-field
This commit is contained in:
@@ -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")));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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') { -%>
|
||||
|
||||
Reference in New Issue
Block a user