[android] - move instrumentation test code to correct package for Android Studio run configurations integration. (#6748)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.activity;
|
||||
package com.mapbox.mapboxsdk.testapp.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -9,8 +9,8 @@ import android.util.Log;
|
||||
import com.mapbox.mapboxsdk.constants.MapboxConstants;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.utils.ScreenshotUtil;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.ScreenshotUtil;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -21,7 +21,7 @@ import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
public abstract class BaseTest {
|
||||
public abstract class BaseActivityTest {
|
||||
|
||||
@Rule
|
||||
public ActivityTestRule<Activity> rule = new ActivityTestRule<>(getActivityClass());
|
||||
@@ -3,11 +3,11 @@
|
||||
const subPackage = locals[1];
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.activity.gen.<%- subPackage %>;
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.<%- subPackage %>;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.activity.BaseTest;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.<%- subPackage %>.<%- activity %>;
|
||||
|
||||
@@ -23,7 +23,7 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
* Sanity test for <%- activity %>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class <%- activity %>Test extends BaseTest {
|
||||
public class <%- activity %>Test extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.AddRemoveMarkerActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for AddRemoveMarkerActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class AddRemoveMarkerActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return AddRemoveMarkerActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.BulkMarkerActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for BulkMarkerActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class BulkMarkerActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return BulkMarkerActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.DynamicMarkerChangeActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for DynamicMarkerChangeActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class DynamicMarkerChangeActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return DynamicMarkerChangeActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.MarkerViewActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for MarkerViewActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class MarkerViewActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return MarkerViewActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.MarkerViewScaleActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for MarkerViewScaleActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class MarkerViewScaleActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return MarkerViewScaleActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.PolygonActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for PolygonActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class PolygonActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return PolygonActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.PolylineActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for PolylineActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class PolylineActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return PolylineActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.annotation;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.PressForMarkerActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for PressForMarkerActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class PressForMarkerActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return PressForMarkerActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.camera;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.camera.CameraAnimationTypeActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for CameraAnimationTypeActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CameraAnimationTypeActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return CameraAnimationTypeActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.camera;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.camera.CameraPositionActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for CameraPositionActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CameraPositionActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return CameraPositionActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.camera;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.camera.LatLngBoundsActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for LatLngBoundsActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class LatLngBoundsActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return LatLngBoundsActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.camera;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.camera.ManualZoomActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for ManualZoomActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ManualZoomActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return ManualZoomActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.camera;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.camera.MaxMinZoomActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for MaxMinZoomActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class MaxMinZoomActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return MaxMinZoomActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.camera;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.camera.ScrollByActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for ScrollByActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ScrollByActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return ScrollByActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.customlayer;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.customlayer.CustomLayerActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for CustomLayerActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CustomLayerActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return CustomLayerActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.directions;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.directions.DirectionsActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for DirectionsActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class DirectionsActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return DirectionsActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.feature;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.feature.QueryRenderedFeaturesBoxCountActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for QueryRenderedFeaturesBoxCountActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class QueryRenderedFeaturesBoxCountActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return QueryRenderedFeaturesBoxCountActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.feature;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.feature.QueryRenderedFeaturesPropertiesActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for QueryRenderedFeaturesPropertiesActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class QueryRenderedFeaturesPropertiesActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return QueryRenderedFeaturesPropertiesActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.geocoding;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.geocoding.GeocoderActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for GeocoderActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class GeocoderActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return GeocoderActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.imagegenerator;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.imagegenerator.PrintActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for PrintActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class PrintActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return PrintActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.infowindow;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.infowindow.DynamicInfoWindowAdapterActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for DynamicInfoWindowAdapterActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class DynamicInfoWindowAdapterActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return DynamicInfoWindowAdapterActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.infowindow;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.infowindow.InfoWindowActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for InfoWindowActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class InfoWindowActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return InfoWindowActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.infowindow;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.infowindow.InfoWindowAdapterActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for InfoWindowAdapterActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class InfoWindowAdapterActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return InfoWindowAdapterActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.maplayout;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.maplayout.DebugModeActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for DebugModeActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class DebugModeActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return DebugModeActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.maplayout;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.maplayout.MapPaddingActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for MapPaddingActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class MapPaddingActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return MapPaddingActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.maplayout;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.maplayout.SurfaceViewMediaControlActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for SurfaceViewMediaControlActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class SurfaceViewMediaControlActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return SurfaceViewMediaControlActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.maplayout;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.maplayout.VideoViewActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for VideoViewActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class VideoViewActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return VideoViewActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.offline;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.offline.OfflineActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for OfflineActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class OfflineActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return OfflineActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.style;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.CircleLayerActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for CircleLayerActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CircleLayerActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return CircleLayerActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.style;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.CustomSpriteActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for CustomSpriteActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CustomSpriteActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return CustomSpriteActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.style;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for RuntimeStyleActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class RuntimeStyleActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return RuntimeStyleActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.style;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTimingTestActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for RuntimeStyleTimingTestActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class RuntimeStyleTimingTestActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return RuntimeStyleTimingTestActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-test-code.js, then run `make generate-test-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.activity.gen.style;
|
||||
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.StyleFileActivity;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Sanity test for StyleFileActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class StyleFileActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
onView(withId(R.id.mapView)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class getActivityClass() {
|
||||
return StyleFileActivity.class;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mapbox.mapboxsdk.camera;
|
||||
package com.mapbox.mapboxsdk.testapp.camera;
|
||||
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.activity.BaseTest;
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMapUtils;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.infowindow.InfoWindowActivity;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
@@ -17,7 +17,7 @@ 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;
|
||||
|
||||
public class RotateTest extends BaseTest {
|
||||
public class RotateActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
// longer testing change second param
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mapbox.mapboxsdk.camera;
|
||||
package com.mapbox.mapboxsdk.testapp.camera;
|
||||
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.activity.BaseTest;
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMapUtils;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.DynamicMarkerChangeActivity;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
@@ -17,7 +17,7 @@ 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;
|
||||
|
||||
public class TiltTest extends BaseTest {
|
||||
public class TiltActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
// longer testing change param
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.mapbox.mapboxsdk.camera;
|
||||
package com.mapbox.mapboxsdk.testapp.camera;
|
||||
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.view.View;
|
||||
|
||||
import com.mapbox.mapboxsdk.activity.BaseTest;
|
||||
import com.mapbox.mapboxsdk.camera.CameraPosition;
|
||||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
|
||||
import com.mapbox.mapboxsdk.constants.MapboxConstants;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.BaseActivityTest;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.maplayout.DebugModeActivity;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
@@ -17,7 +19,7 @@ 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;
|
||||
|
||||
public class ZoomTest extends BaseTest {
|
||||
public class ZoomActivityTest extends BaseActivityTest {
|
||||
|
||||
@Test
|
||||
// longer testing increase second param
|
||||
@@ -0,0 +1,136 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.BackgroundLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
/**
|
||||
* Basic smoke tests for BackgroundLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class BackgroundLayerStyleTest extends BaseStyleTest {
|
||||
private static final String TAG = BackgroundLayerStyleTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTestActivity.class);
|
||||
|
||||
private BackgroundLayer layer;
|
||||
|
||||
private OnMapReadyIdlingResource idlingResource;
|
||||
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
idlingResource = new OnMapReadyIdlingResource(rule.getActivity());
|
||||
Espresso.registerIdlingResources(idlingResource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetVisibility() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
Log.i(TAG, "Retrieving layer");
|
||||
layer = mapboxMap.getLayerAs("background");
|
||||
Log.i(TAG, "visibility");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Get initial
|
||||
assertEquals(layer.getVisibility().getValue(), VISIBLE);
|
||||
|
||||
//Set
|
||||
layer.setProperties(visibility(NONE));
|
||||
assertEquals(layer.getVisibility().getValue(), NONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBackgroundColor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
Log.i(TAG, "Retrieving layer");
|
||||
layer = mapboxMap.getLayerAs("background");
|
||||
Log.i(TAG, "background-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(backgroundColor("rgba(0, 0, 0, 1)"));
|
||||
assertEquals((String) layer.getBackgroundColor().getValue(), (String) "rgba(0, 0, 0, 1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBackgroundColorAsInt() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
Log.i(TAG, "Retrieving layer");
|
||||
layer = mapboxMap.getLayerAs("background");
|
||||
Log.i(TAG, "background-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(backgroundColor(Color.RED));
|
||||
assertEquals(layer.getBackgroundColorAsInt(), Color.RED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBackgroundPattern() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
Log.i(TAG, "Retrieving layer");
|
||||
layer = mapboxMap.getLayerAs("background");
|
||||
Log.i(TAG, "background-pattern");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(backgroundPattern("pedestrian-polygon"));
|
||||
assertEquals((String) layer.getBackgroundPattern().getValue(), (String) "pedestrian-polygon");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBackgroundOpacity() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
Log.i(TAG, "Retrieving layer");
|
||||
layer = mapboxMap.getLayerAs("background");
|
||||
Log.i(TAG, "background-opacity");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(backgroundOpacity(0.3f));
|
||||
assertEquals((Float) layer.getBackgroundOpacity().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void unregisterIntentServiceIdlingResource() {
|
||||
Espresso.unregisterIdlingResources(idlingResource);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -11,7 +11,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.BackgroundLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -27,7 +27,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for BackgroundLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class BackgroundLayerTest extends BaseTest {
|
||||
public class BackgroundLayerTest extends BaseStyleTest {
|
||||
private static final String TAG = BackgroundLayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.mapbox.mapboxsdk.utils.ScreenshotUtil;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.ScreenshotUtil;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
@@ -10,9 +10,9 @@ import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
/**
|
||||
* Base Espresso class for all tests, helps working with ActivityInstrumentationTestCase2
|
||||
* Base Test class for Style tests
|
||||
*/
|
||||
public class BaseTest {
|
||||
public class BaseStyleTest {
|
||||
|
||||
protected final static String HOME_BUTTON_STRING = "Navigate up";
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.CircleLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
/**
|
||||
* Basic smoke tests for CircleLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CircleLayerStyleTest extends BaseStyleTest {
|
||||
private static final String TAG = CircleLayerStyleTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTestActivity.class);
|
||||
|
||||
private CircleLayer layer;
|
||||
|
||||
private OnMapReadyIdlingResource idlingResource;
|
||||
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
idlingResource = new OnMapReadyIdlingResource(rule.getActivity());
|
||||
Espresso.registerIdlingResources(idlingResource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetVisibility() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "visibility");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Get initial
|
||||
assertEquals(layer.getVisibility().getValue(), VISIBLE);
|
||||
|
||||
//Set
|
||||
layer.setProperties(visibility(NONE));
|
||||
assertEquals(layer.getVisibility().getValue(), NONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleRadius() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-radius");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleRadius(0.3f));
|
||||
assertEquals((Float) layer.getCircleRadius().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleColor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleColor("rgba(0, 0, 0, 1)"));
|
||||
assertEquals((String) layer.getCircleColor().getValue(), (String) "rgba(0, 0, 0, 1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleColorAsInt() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleColor(Color.RED));
|
||||
assertEquals(layer.getCircleColorAsInt(), Color.RED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleBlur() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-blur");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleBlur(0.3f));
|
||||
assertEquals((Float) layer.getCircleBlur().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleOpacity() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-opacity");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleOpacity(0.3f));
|
||||
assertEquals((Float) layer.getCircleOpacity().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleTranslate() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-translate");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleTranslate(new Float[]{0f,0f}));
|
||||
assertEquals((Float[]) layer.getCircleTranslate().getValue(), (Float[]) new Float[]{0f,0f});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCircleTranslateAnchor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-translate-anchor");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circleTranslateAnchor(CIRCLE_TRANSLATE_ANCHOR_MAP));
|
||||
assertEquals((String) layer.getCircleTranslateAnchor().getValue(), (String) CIRCLE_TRANSLATE_ANCHOR_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCirclePitchScale() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new CircleLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "circle-pitch-scale");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(circlePitchScale(CIRCLE_PITCH_SCALE_MAP));
|
||||
assertEquals((String) layer.getCirclePitchScale().getValue(), (String) CIRCLE_PITCH_SCALE_MAP);
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void unregisterIntentServiceIdlingResource() {
|
||||
Espresso.unregisterIdlingResources(idlingResource);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -11,7 +11,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.CircleLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -27,7 +27,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for CircleLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CircleLayerTest extends BaseTest {
|
||||
public class CircleLayerTest extends BaseStyleTest {
|
||||
private static final String TAG = CircleLayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -0,0 +1,276 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.FillLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
/**
|
||||
* Basic smoke tests for FillLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FillLayerStyleTest extends BaseStyleTest {
|
||||
private static final String TAG = FillLayerStyleTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTestActivity.class);
|
||||
|
||||
private FillLayer layer;
|
||||
|
||||
private OnMapReadyIdlingResource idlingResource;
|
||||
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
idlingResource = new OnMapReadyIdlingResource(rule.getActivity());
|
||||
Espresso.registerIdlingResources(idlingResource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetVisibility() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "visibility");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Get initial
|
||||
assertEquals(layer.getVisibility().getValue(), VISIBLE);
|
||||
|
||||
//Set
|
||||
layer.setProperties(visibility(NONE));
|
||||
assertEquals(layer.getVisibility().getValue(), NONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillAntialias() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-antialias");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillAntialias(true));
|
||||
assertEquals((Boolean) layer.getFillAntialias().getValue(), (Boolean) true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillOpacity() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-opacity");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillOpacity(0.3f));
|
||||
assertEquals((Float) layer.getFillOpacity().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillColor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillColor("rgba(0, 0, 0, 1)"));
|
||||
assertEquals((String) layer.getFillColor().getValue(), (String) "rgba(0, 0, 0, 1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillColorAsInt() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillColor(Color.RED));
|
||||
assertEquals(layer.getFillColorAsInt(), Color.RED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillOutlineColor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-outline-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillOutlineColor("rgba(0, 0, 0, 1)"));
|
||||
assertEquals((String) layer.getFillOutlineColor().getValue(), (String) "rgba(0, 0, 0, 1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillOutlineColorAsInt() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-outline-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillOutlineColor(Color.RED));
|
||||
assertEquals(layer.getFillOutlineColorAsInt(), Color.RED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillTranslate() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-translate");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillTranslate(new Float[]{0f,0f}));
|
||||
assertEquals((Float[]) layer.getFillTranslate().getValue(), (Float[]) new Float[]{0f,0f});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillTranslateAnchor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-translate-anchor");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillTranslateAnchor(FILL_TRANSLATE_ANCHOR_MAP));
|
||||
assertEquals((String) layer.getFillTranslateAnchor().getValue(), (String) FILL_TRANSLATE_ANCHOR_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillPattern() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new FillLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "fill-pattern");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(fillPattern("pedestrian-polygon"));
|
||||
assertEquals((String) layer.getFillPattern().getValue(), (String) "pedestrian-polygon");
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void unregisterIntentServiceIdlingResource() {
|
||||
Espresso.unregisterIdlingResources(idlingResource);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -11,7 +11,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.FillLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -27,7 +27,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for FillLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class FillLayerTest extends BaseTest {
|
||||
public class FillLayerTest extends BaseStyleTest {
|
||||
private static final String TAG = FillLayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -0,0 +1,408 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.LineLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
/**
|
||||
* Basic smoke tests for LineLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class LineLayerStyleTest extends BaseStyleTest {
|
||||
private static final String TAG = LineLayerStyleTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTestActivity.class);
|
||||
|
||||
private LineLayer layer;
|
||||
|
||||
private OnMapReadyIdlingResource idlingResource;
|
||||
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
idlingResource = new OnMapReadyIdlingResource(rule.getActivity());
|
||||
Espresso.registerIdlingResources(idlingResource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetVisibility() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "visibility");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Get initial
|
||||
assertEquals(layer.getVisibility().getValue(), VISIBLE);
|
||||
|
||||
//Set
|
||||
layer.setProperties(visibility(NONE));
|
||||
assertEquals(layer.getVisibility().getValue(), NONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineCap() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-cap");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineCap(LINE_CAP_BUTT));
|
||||
assertEquals((String) layer.getLineCap().getValue(), (String) LINE_CAP_BUTT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineJoin() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-join");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineJoin(LINE_JOIN_BEVEL));
|
||||
assertEquals((String) layer.getLineJoin().getValue(), (String) LINE_JOIN_BEVEL);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineMiterLimit() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-miter-limit");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineMiterLimit(0.3f));
|
||||
assertEquals((Float) layer.getLineMiterLimit().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineRoundLimit() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-round-limit");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineRoundLimit(0.3f));
|
||||
assertEquals((Float) layer.getLineRoundLimit().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineOpacity() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-opacity");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineOpacity(0.3f));
|
||||
assertEquals((Float) layer.getLineOpacity().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineColor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineColor("rgba(0, 0, 0, 1)"));
|
||||
assertEquals((String) layer.getLineColor().getValue(), (String) "rgba(0, 0, 0, 1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineColorAsInt() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-color");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineColor(Color.RED));
|
||||
assertEquals(layer.getLineColorAsInt(), Color.RED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineTranslate() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-translate");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineTranslate(new Float[]{0f,0f}));
|
||||
assertEquals((Float[]) layer.getLineTranslate().getValue(), (Float[]) new Float[]{0f,0f});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineTranslateAnchor() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-translate-anchor");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineTranslateAnchor(LINE_TRANSLATE_ANCHOR_MAP));
|
||||
assertEquals((String) layer.getLineTranslateAnchor().getValue(), (String) LINE_TRANSLATE_ANCHOR_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineWidth() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-width");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineWidth(0.3f));
|
||||
assertEquals((Float) layer.getLineWidth().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineGapWidth() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-gap-width");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineGapWidth(0.3f));
|
||||
assertEquals((Float) layer.getLineGapWidth().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineOffset() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-offset");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineOffset(0.3f));
|
||||
assertEquals((Float) layer.getLineOffset().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineBlur() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-blur");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineBlur(0.3f));
|
||||
assertEquals((Float) layer.getLineBlur().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineDasharray() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-dasharray");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(lineDasharray(new Float[]{}));
|
||||
assertEquals((Float[]) layer.getLineDasharray().getValue(), (Float[]) new Float[]{});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLinePattern() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new LineLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "line-pattern");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(linePattern("pedestrian-polygon"));
|
||||
assertEquals((String) layer.getLinePattern().getValue(), (String) "pedestrian-polygon");
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void unregisterIntentServiceIdlingResource() {
|
||||
Espresso.unregisterIdlingResources(idlingResource);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -11,7 +11,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.LineLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -27,7 +27,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for LineLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class LineLayerTest extends BaseTest {
|
||||
public class LineLayerTest extends BaseStyleTest {
|
||||
private static final String TAG = LineLayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -0,0 +1,231 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.RasterLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.*;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
|
||||
/**
|
||||
* Basic smoke tests for RasterLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class RasterLayerStyleTest extends BaseStyleTest {
|
||||
private static final String TAG = RasterLayerStyleTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTestActivity.class);
|
||||
|
||||
private RasterLayer layer;
|
||||
|
||||
private OnMapReadyIdlingResource idlingResource;
|
||||
|
||||
private MapboxMap mapboxMap;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
idlingResource = new OnMapReadyIdlingResource(rule.getActivity());
|
||||
Espresso.registerIdlingResources(idlingResource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetVisibility() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "visibility");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Get initial
|
||||
assertEquals(layer.getVisibility().getValue(), VISIBLE);
|
||||
|
||||
//Set
|
||||
layer.setProperties(visibility(NONE));
|
||||
assertEquals(layer.getVisibility().getValue(), NONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterOpacity() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-opacity");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterOpacity(0.3f));
|
||||
assertEquals((Float) layer.getRasterOpacity().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterHueRotate() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-hue-rotate");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterHueRotate(0.3f));
|
||||
assertEquals((Float) layer.getRasterHueRotate().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterBrightnessMin() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-brightness-min");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterBrightnessMin(0.3f));
|
||||
assertEquals((Float) layer.getRasterBrightnessMin().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterBrightnessMax() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-brightness-max");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterBrightnessMax(0.3f));
|
||||
assertEquals((Float) layer.getRasterBrightnessMax().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterSaturation() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-saturation");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterSaturation(0.3f));
|
||||
assertEquals((Float) layer.getRasterSaturation().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterContrast() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-contrast");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterContrast(0.3f));
|
||||
assertEquals((Float) layer.getRasterContrast().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRasterFadeDuration() {
|
||||
checkViewIsDisplayed(R.id.mapView);
|
||||
|
||||
mapboxMap = rule.getActivity().getMapboxMap();
|
||||
|
||||
if ((layer = mapboxMap.getLayerAs("my-layer")) == null) {
|
||||
Log.i(TAG, "Adding layer");
|
||||
layer = new RasterLayer("my-layer", "composite");
|
||||
layer.setSourceLayer("composite");
|
||||
mapboxMap.addLayer(layer);
|
||||
//Layer reference is now stale, get new reference
|
||||
layer = mapboxMap.getLayerAs("my-layer");
|
||||
}
|
||||
Log.i(TAG, "raster-fade-duration");
|
||||
assertNotNull(layer);
|
||||
|
||||
//Set and Get
|
||||
layer.setProperties(rasterFadeDuration(0.3f));
|
||||
assertEquals((Float) layer.getRasterFadeDuration().getValue(), (Float) 0.3f);
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void unregisterIntentServiceIdlingResource() {
|
||||
Espresso.unregisterIdlingResources(idlingResource);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -11,7 +11,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.RasterLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -27,7 +27,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for RasterLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class RasterLayerTest extends BaseTest {
|
||||
public class RasterLayerTest extends BaseStyleTest {
|
||||
private static final String TAG = RasterLayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
@@ -13,7 +13,7 @@ import com.mapbox.mapboxsdk.style.sources.NoSuchSourceException;
|
||||
import com.mapbox.mapboxsdk.style.sources.VectorSource;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -31,7 +31,7 @@ import static org.junit.Assert.assertTrue;
|
||||
* Basic smoke tests for Layer and Source
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class RuntimeStyleTests extends BaseTest {
|
||||
public class RuntimeStyleTests extends BaseStyleTest {
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTestActivity.class);
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTimingTestActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -18,7 +18,7 @@ import org.junit.runner.RunWith;
|
||||
* Basic smoke tests for adding Layer and Source as early as possible (in onCreate)
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class RuntimeStyleTimingTests extends BaseTest {
|
||||
public class RuntimeStyleTimingTests extends BaseStyleTest {
|
||||
|
||||
@Rule
|
||||
public final ActivityTestRule<RuntimeStyleTimingTestActivity> rule = new ActivityTestRule<>(RuntimeStyleTimingTestActivity.class);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -11,7 +11,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.SymbolLayer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -27,7 +27,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for SymbolLayer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class SymbolLayerTest extends BaseTest {
|
||||
public class SymbolLayerTest extends BaseStyleTest {
|
||||
private static final String TAG = SymbolLayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -3,7 +3,7 @@
|
||||
const properties = locals.properties;
|
||||
-%>
|
||||
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
|
||||
package com.mapbox.mapboxsdk.style;
|
||||
package com.mapbox.mapboxsdk.testapp.style;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -15,7 +15,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.style.layers.<%- camelize(type) %>Layer;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleTestActivity;
|
||||
import com.mapbox.mapboxsdk.utils.OnMapReadyIdlingResource;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.OnMapReadyIdlingResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -31,7 +31,7 @@ import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.*;
|
||||
* Basic smoke tests for <%- camelize(type) %>Layer
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class <%- camelize(type) %>LayerTest extends BaseTest {
|
||||
public class <%- camelize(type) %>LayerTest extends BaseStyleTest {
|
||||
private static final String TAG = <%- camelize(type) %>LayerTest.class.getSimpleName();
|
||||
|
||||
@Rule
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.utils;
|
||||
package com.mapbox.mapboxsdk.testapp.utils;
|
||||
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.test.espresso.Espresso;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.utils;
|
||||
package com.mapbox.mapboxsdk.testapp.utils;
|
||||
|
||||
import android.support.annotation.IdRes;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.utils;
|
||||
package com.mapbox.mapboxsdk.testapp.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.support.test.espresso.IdlingResource;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.utils;
|
||||
package com.mapbox.mapboxsdk.testapp.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxsdk.utils;
|
||||
package com.mapbox.mapboxsdk.testapp.utils;
|
||||
|
||||
import android.support.annotation.IdRes;
|
||||
|
||||
Reference in New Issue
Block a user