Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Upgrades Robolectric to version 3.2.1 (#153)
Browse files Browse the repository at this point in the history
* Upgrades Robolectric to version 3.2.1

* Add checkstyle suppression for copied file `LostShadowLocationManager.java`
  • Loading branch information
ecgreb authored and sarahsnow1 committed Jan 17, 2017
1 parent 27cd5af commit baaf20b
Show file tree
Hide file tree
Showing 9 changed files with 517 additions and 578 deletions.
1 change: 1 addition & 0 deletions config/checkstyle/suppressions.xml
Expand Up @@ -10,4 +10,5 @@

<suppress checks="ConstantName" files="src/main/java/com/mapzen/android/lost/api/LocationServices.java"/>
<suppress checks="VisibilityModifier" files="src/main/java/com/mapzen/android/lost/api/LocationServices.java" />
<suppress checks="[a-zA-Z0-9]*" files="src/test/java/com/mapzen/android/lost/shadows/LostShadowLocationManager.java"/>
</suppressions>
3 changes: 1 addition & 2 deletions lost/build.gradle
Expand Up @@ -69,10 +69,9 @@ dependencies {

testCompile 'com.google.guava:guava:18.0'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'org.robolectric:robolectric:3.2.1'
testCompile 'com.squareup:fest-android:1.0.7'
testCompile 'org.mockito:mockito-core:1.9.5'

}

apply from: file('../gradle-mvn-push.gradle')
Expand Up @@ -5,14 +5,14 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import static com.mapzen.android.lost.api.LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY;
import static com.mapzen.android.lost.api.LocationRequest.PRIORITY_HIGH_ACCURACY;
import static org.fest.assertions.api.Assertions.assertThat;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = Config.NONE)
public class LocationRequestTest {
private LocationRequest locationRequest;
Expand Down
Expand Up @@ -7,12 +7,12 @@

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import static org.fest.assertions.api.Assertions.assertThat;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = Config.NONE)
public class LocationServicesTest {

Expand Down
Expand Up @@ -521,9 +521,10 @@ private File getTestGpxTrace() throws IOException {

@Test public void requestLocationUpdates_shouldNotNotifyRemovedPendingIntent() throws Exception {
LocationRequest request = LocationRequest.create().setPriority(PRIORITY_HIGH_ACCURACY);
Intent intent = new Intent(application, TestService.class);
PendingIntent pendingIntent1 = PendingIntent.getService(application, 0, intent, 0);
PendingIntent pendingIntent2 = PendingIntent.getService(application, 0, intent, 0);
Intent intent1 = new Intent(application, TestService.class);
Intent intent2 = new Intent(application, OtherTestService.class);
PendingIntent pendingIntent1 = PendingIntent.getService(application, 0, intent1, 0);
PendingIntent pendingIntent2 = PendingIntent.getService(application, 0, intent2, 0);
api.requestLocationUpdates(client, request, pendingIntent1);
api.requestLocationUpdates(client, request, pendingIntent2);

Expand Down Expand Up @@ -1300,11 +1301,19 @@ private File getTestGpxTrace() throws IOException {

public class TestService extends IntentService {
public TestService() {
super("test");
super("test service");
}

@Override protected void onHandleIntent(Intent intent) {
}
}

public class OtherTestService extends IntentService {
public OtherTestService() {
super("other test service");
}

@Override protected void onHandleIntent(Intent intent) {
}
}
}
Expand Up @@ -6,7 +6,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLocationManager;

Expand Down Expand Up @@ -36,7 +36,7 @@
import static org.robolectric.RuntimeEnvironment.application;
import static org.robolectric.Shadows.shadowOf;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = Config.NONE)
public class FusionEngineTest {
private FusionEngine fusionEngine;
Expand Down
Expand Up @@ -8,7 +8,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import android.content.Context;
Expand All @@ -25,7 +25,7 @@
import static org.mockito.Mockito.when;

@SuppressWarnings("MissingPermission")
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = Config.NONE)
public class GeofencingIntentSenderTest {

Expand Down
Expand Up @@ -10,7 +10,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import android.content.ComponentName;
Expand All @@ -24,7 +24,7 @@
import static org.robolectric.RuntimeEnvironment.application;
import static org.robolectric.Shadows.shadowOf;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = Config.NONE)
public class LostApiClientImplTest {
private LostApiClient client;
Expand Down

0 comments on commit baaf20b

Please sign in to comment.