forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -9,10 +9,10 @@ import androidx.test.espresso.ViewAction;
|
||||
import androidx.test.espresso.ViewAssertion;
|
||||
import androidx.test.espresso.ViewInteraction;
|
||||
import androidx.test.espresso.action.MotionEvents;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.filters.LargeTest;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import androidx.test.rule.GrantPermissionRule;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -83,7 +83,7 @@ public class EspressoCustomLayoutTest {
|
||||
}
|
||||
|
||||
RecyclerView recyclerView = (RecyclerView) view;
|
||||
RecyclerView.Adapter adapter = recyclerView.getAdapter();
|
||||
RecyclerView.Adapter<?> adapter = recyclerView.getAdapter();
|
||||
assertThat(adapter.getItemCount(), is(expectedCount));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class EspressoDeleteTrackTest {
|
||||
private static Matcher<View> childAtPosition(
|
||||
final Matcher<View> parentMatcher, final int position) {
|
||||
|
||||
return new TypeSafeMatcher<View>() {
|
||||
return new TypeSafeMatcher<>() {
|
||||
@Override
|
||||
public void describeTo(Description description) {
|
||||
description.appendText("Child at position " + position + " in parent ");
|
||||
@@ -160,13 +160,15 @@ public class EspressoDeleteTrackTest {
|
||||
}
|
||||
|
||||
public static Matcher<View> withListSize (final int size) {
|
||||
return new TypeSafeMatcher<View> () {
|
||||
@Override public boolean matchesSafely (final View view) {
|
||||
return ((ListView) view).getCount () == size;
|
||||
return new TypeSafeMatcher<>() {
|
||||
@Override
|
||||
public boolean matchesSafely(final View view) {
|
||||
return ((ListView) view).getCount() == size;
|
||||
}
|
||||
|
||||
@Override public void describeTo (final Description description) {
|
||||
description.appendText ("ListView should have " + size + " items");
|
||||
@Override
|
||||
public void describeTo(final Description description) {
|
||||
description.appendText("ListView should have " + size + " items");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class EspressoEditTrackRecordingTest {
|
||||
// check track's name is "New Name"
|
||||
ViewInteraction textView = onView(
|
||||
allOf(withId(R.id.stats_name_value),
|
||||
withParent(withParent(IsInstanceOf.<View>instanceOf(android.widget.ScrollView.class))),
|
||||
withParent(withParent(IsInstanceOf.instanceOf(android.widget.ScrollView.class))),
|
||||
isDisplayed()));
|
||||
textView.check(matches(withText("New Name")));
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class EspressoEditTrackRecordingTest {
|
||||
private static Matcher<View> childAtPosition(
|
||||
final Matcher<View> parentMatcher, final int position) {
|
||||
|
||||
return new TypeSafeMatcher<View>() {
|
||||
return new TypeSafeMatcher<>() {
|
||||
@Override
|
||||
public void describeTo(Description description) {
|
||||
description.appendText("Child at position " + position + " in parent ");
|
||||
|
||||
+6
-6
@@ -107,7 +107,7 @@ public class TrackRecordingServiceTestLocation {
|
||||
|
||||
@MediumTest
|
||||
@Test
|
||||
public void testOnLocationChangedAsync_movingAccurate() throws Exception {
|
||||
public void testOnLocationChangedAsync_movingAccurate() {
|
||||
// given
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
service.getHandlerServer().setAltitudeSumManager(altitudeSumManager);
|
||||
@@ -180,7 +180,7 @@ public class TrackRecordingServiceTestLocation {
|
||||
|
||||
@MediumTest
|
||||
@Test
|
||||
public void testOnLocationChangedAsync_slowMovingAccurate() throws Exception {
|
||||
public void testOnLocationChangedAsync_slowMovingAccurate() {
|
||||
// given
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
service.getHandlerServer().setAltitudeSumManager(altitudeSumManager);
|
||||
@@ -225,7 +225,7 @@ public class TrackRecordingServiceTestLocation {
|
||||
|
||||
@MediumTest
|
||||
@Test
|
||||
public void testOnLocationChangedAsync_idle() throws Exception {
|
||||
public void testOnLocationChangedAsync_idle() {
|
||||
// given
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
service.getHandlerServer().setAltitudeSumManager(altitudeSumManager);
|
||||
@@ -277,7 +277,7 @@ public class TrackRecordingServiceTestLocation {
|
||||
|
||||
@MediumTest
|
||||
@Test
|
||||
public void testOnLocationChangedAsync_idle_withMovement() throws Exception {
|
||||
public void testOnLocationChangedAsync_idle_withMovement() {
|
||||
// given
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
service.getHandlerServer().setAltitudeSumManager(altitudeSumManager);
|
||||
@@ -337,7 +337,7 @@ public class TrackRecordingServiceTestLocation {
|
||||
|
||||
@MediumTest
|
||||
@Test
|
||||
public void testOnLocationChangedAsync_idle_withSensorData() throws Exception {
|
||||
public void testOnLocationChangedAsync_idle_withSensorData() {
|
||||
// given
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
service.getHandlerServer().setAltitudeSumManager(altitudeSumManager);
|
||||
@@ -432,7 +432,7 @@ public class TrackRecordingServiceTestLocation {
|
||||
|
||||
@MediumTest
|
||||
@Test
|
||||
public void testOnLocationChangedAsync_segment() throws Exception {
|
||||
public void testOnLocationChangedAsync_segment() {
|
||||
// given
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
service.getHandlerServer().setAltitudeSumManager(altitudeSumManager);
|
||||
|
||||
Reference in New Issue
Block a user