Skip to content

Commit 4f317e9

Browse files
authored
Update the deprecated test dependencies. (#532)
Also bumps the Kotlin version to 1.3.61
1 parent a86c232 commit 4f317e9

File tree

5 files changed

+40
-13
lines changed

5 files changed

+40
-13
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ buildscript {
3030
androidxPreferenceVersion = "1.1.0"
3131
androidxRecyclerViewVersion = "1.1.0"
3232
androidxEspressoVersion = "3.2.0"
33+
androidxTestExtVersion = "1.1.1"
3334
androidxTestVersion = "1.2.0"
3435
junitVersion = "4.12"
3536
gradleBintrayPluginVersion = "1.6"
36-
kotlinVersion = "1.3.50"
37+
kotlinVersion = "1.3.61"
3738
materialVersion = "1.0.0"
3839
}
3940

flexbox/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ dependencies {
5252
androidTestImplementation "androidx.core:core:${rootProject.androidxCoreVersion}"
5353
androidTestImplementation "androidx.recyclerview:recyclerview:${rootProject.androidxRecyclerViewVersion}"
5454
androidTestImplementation "androidx.annotation:annotation:${rootProject.androidxAnnotationVersion}"
55+
androidTestImplementation "androidx.test.ext:junit:${rootProject.androidxTestExtVersion}"
5556
androidTestImplementation "androidx.test:runner:${rootProject.androidxTestVersion}"
5657
androidTestImplementation "androidx.test:rules:${rootProject.androidxTestVersion}"
5758
androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.androidxEspressoVersion}"

flexbox/src/androidTest/java/com/google/android/flexbox/FlexboxHelperTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import android.view.View
2020
import android.widget.CheckBox
2121
import android.widget.TextView
2222
import androidx.core.widget.CompoundButtonCompat
23+
import androidx.test.ext.junit.runners.AndroidJUnit4
2324
import androidx.test.rule.ActivityTestRule
24-
import androidx.test.runner.AndroidJUnit4
2525
import com.google.android.flexbox.test.FlexboxTestActivity
2626
import com.google.android.flexbox.test.IsEqualAllowingError.Companion.isEqualAllowingError
2727
import org.hamcrest.Matchers.`is`

flexbox/src/androidTest/java/com/google/android/flexbox/test/FlexboxAndroidTest.kt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,29 @@ import android.view.ViewGroup
2222
import android.widget.TextView
2323
import androidx.annotation.LayoutRes
2424
import androidx.core.content.res.ResourcesCompat
25-
import androidx.test.InstrumentationRegistry
2625
import androidx.test.espresso.Espresso.onView
2726
import androidx.test.espresso.ViewAssertion
28-
import androidx.test.espresso.assertion.PositionAssertions.*
27+
import androidx.test.espresso.assertion.PositionAssertions.isBottomAlignedWith
28+
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyAbove
29+
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyBelow
30+
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyLeftOf
31+
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyRightOf
32+
import androidx.test.espresso.assertion.PositionAssertions.isLeftAlignedWith
33+
import androidx.test.espresso.assertion.PositionAssertions.isRightAlignedWith
34+
import androidx.test.espresso.assertion.PositionAssertions.isTopAlignedWith
2935
import androidx.test.espresso.assertion.ViewAssertions.matches
3036
import androidx.test.espresso.matcher.ViewMatchers.withId
37+
import androidx.test.ext.junit.runners.AndroidJUnit4
3138
import androidx.test.filters.FlakyTest
3239
import androidx.test.filters.MediumTest
40+
import androidx.test.platform.app.InstrumentationRegistry
3341
import androidx.test.rule.ActivityTestRule
34-
import androidx.test.runner.AndroidJUnit4
35-
import com.google.android.flexbox.*
42+
import com.google.android.flexbox.AlignContent
43+
import com.google.android.flexbox.AlignItems
44+
import com.google.android.flexbox.FlexDirection
45+
import com.google.android.flexbox.FlexWrap
46+
import com.google.android.flexbox.FlexboxLayout
47+
import com.google.android.flexbox.JustifyContent
3648
import com.google.android.flexbox.test.IsEqualAllowingError.Companion.isEqualAllowingError
3749
import org.hamcrest.Description
3850
import org.hamcrest.TypeSafeMatcher

flexbox/src/androidTest/java/com/google/android/flexbox/test/FlexboxLayoutManagerTest.kt

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,33 @@ import android.widget.TextView
2424
import androidx.core.content.res.ResourcesCompat
2525
import androidx.recyclerview.widget.LinearLayoutManager
2626
import androidx.recyclerview.widget.RecyclerView
27-
import androidx.test.InstrumentationRegistry
2827
import androidx.test.espresso.Espresso.onView
2928
import androidx.test.espresso.ViewAction
30-
import androidx.test.espresso.action.*
29+
import androidx.test.espresso.action.CoordinatesProvider
30+
import androidx.test.espresso.action.GeneralLocation
31+
import androidx.test.espresso.action.GeneralSwipeAction
32+
import androidx.test.espresso.action.Press
33+
import androidx.test.espresso.action.Swipe
3134
import androidx.test.espresso.matcher.ViewMatchers.withId
35+
import androidx.test.ext.junit.runners.AndroidJUnit4
3236
import androidx.test.filters.FlakyTest
3337
import androidx.test.filters.MediumTest
38+
import androidx.test.platform.app.InstrumentationRegistry
3439
import androidx.test.rule.ActivityTestRule
35-
import androidx.test.runner.AndroidJUnit4
36-
import com.google.android.flexbox.*
40+
import com.google.android.flexbox.AlignItems
41+
import com.google.android.flexbox.AlignSelf
42+
import com.google.android.flexbox.FlexDirection
43+
import com.google.android.flexbox.FlexWrap
44+
import com.google.android.flexbox.FlexboxItemDecoration
3745
import com.google.android.flexbox.FlexboxItemDecoration.HORIZONTAL
3846
import com.google.android.flexbox.FlexboxItemDecoration.VERTICAL
47+
import com.google.android.flexbox.FlexboxLayoutManager
48+
import com.google.android.flexbox.JustifyContent
3949
import com.google.android.flexbox.test.IsEqualAllowingError.Companion.isEqualAllowingError
40-
import org.hamcrest.Matchers.*
50+
import org.hamcrest.Matchers.`is`
51+
import org.hamcrest.Matchers.instanceOf
52+
import org.hamcrest.Matchers.lessThan
53+
import org.hamcrest.Matchers.notNullValue
4154
import org.hamcrest.core.IsNot.not
4255
import org.junit.Assert.assertThat
4356
import org.junit.Assert.assertTrue
@@ -2808,7 +2821,7 @@ class FlexboxLayoutManagerTest {
28082821
// https://github.com/google/flexbox-layout/issues/208, the width of the inner
28092822
// RecyclerViews were set to 0.
28102823
val activity = activityRule.activity
2811-
val outerLayoutManager = androidx.recyclerview.widget.LinearLayoutManager(activity)
2824+
val outerLayoutManager = LinearLayoutManager(activity)
28122825

28132826
// Give the inner adapter item count enough so that inner RecyclerView with
28142827
// FlexboxLayoutManager wraps its items
@@ -2818,7 +2831,7 @@ class FlexboxLayoutManagerTest {
28182831
activityRule.runOnUiThread {
28192832
activity.setContentView(R.layout.recyclerview)
28202833
val recyclerView = activity.findViewById<RecyclerView>(R.id.recyclerview)
2821-
outerLayoutManager.orientation = androidx.recyclerview.widget.LinearLayoutManager.HORIZONTAL
2834+
outerLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
28222835
recyclerView.layoutManager = outerLayoutManager
28232836
recyclerView.adapter = adapter
28242837
}

0 commit comments

Comments
 (0)