Update generate-style-code and add sort key api for LineLayer and FillLayer. (#209)
This commit is contained in:
@@ -10,11 +10,13 @@ import com.mapbox.mapboxsdk.maps.BaseLayerTest;
|
||||
import org.junit.Before;
|
||||
import timber.log.Timber;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.BackgroundLayer;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
@@ -99,6 +99,32 @@ public class FillLayerTest extends BaseLayerTest {
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
public void testFillSortKeyAsConstant() {
|
||||
Timber.i("fill-sort-key");
|
||||
assertNotNull(layer);
|
||||
assertNull(layer.getFillSortKey().getValue());
|
||||
|
||||
// Set and Get
|
||||
Float propertyValue = 0.3f;
|
||||
layer.setProperties(fillSortKey(propertyValue));
|
||||
assertEquals(layer.getFillSortKey().getValue(), propertyValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
public void testFillSortKeyAsExpression() {
|
||||
Timber.i("fill-sort-key-expression");
|
||||
assertNotNull(layer);
|
||||
assertNull(layer.getFillSortKey().getExpression());
|
||||
|
||||
// Set and Get
|
||||
Expression expression = number(Expression.get("undefined"));
|
||||
layer.setProperties(fillSortKey(expression));
|
||||
assertEquals(layer.getFillSortKey().getExpression(), expression);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
public void testFillAntialiasAsConstant() {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import androidx.test.annotation.UiThreadTest;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
|
||||
@@ -10,11 +10,13 @@ import com.mapbox.mapboxsdk.maps.BaseLayerTest;
|
||||
import org.junit.Before;
|
||||
import timber.log.Timber;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.HillshadeLayer;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
@@ -164,6 +164,32 @@ public class LineLayerTest extends BaseLayerTest {
|
||||
assertEquals(layer.getLineRoundLimit().getValue(), propertyValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
public void testLineSortKeyAsConstant() {
|
||||
Timber.i("line-sort-key");
|
||||
assertNotNull(layer);
|
||||
assertNull(layer.getLineSortKey().getValue());
|
||||
|
||||
// Set and Get
|
||||
Float propertyValue = 0.3f;
|
||||
layer.setProperties(lineSortKey(propertyValue));
|
||||
assertEquals(layer.getLineSortKey().getValue(), propertyValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
public void testLineSortKeyAsExpression() {
|
||||
Timber.i("line-sort-key-expression");
|
||||
assertNotNull(layer);
|
||||
assertNull(layer.getLineSortKey().getExpression());
|
||||
|
||||
// Set and Get
|
||||
Expression expression = number(Expression.get("undefined"));
|
||||
layer.setProperties(lineSortKey(expression));
|
||||
assertEquals(layer.getLineSortKey().getExpression(), expression);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
public void testLineOpacityTransition() {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import androidx.test.annotation.UiThreadTest;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
@@ -9,11 +10,13 @@ import com.mapbox.mapboxsdk.maps.BaseLayerTest;
|
||||
import org.junit.Before;
|
||||
import timber.log.Timber;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.RasterLayer;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.annotation.UiThreadTest;
|
||||
import androidx.test.annotation.UiThreadTest;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.BaseLayerTest;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import androidx.test.espresso.UiController;
|
||||
import androidx.test.espresso.ViewAction;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import android.view.View;
|
||||
|
||||
@@ -24,9 +24,9 @@ import org.hamcrest.Matcher;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static androidx.test.espresso.Espresso.onView;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.eq;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.ANCHOR_MAP;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionBase;
|
||||
|
||||
Reference in New Issue
Block a user