Skip to content

Commit

Permalink
Update the deprecated test dependencies. (#532)
Browse files Browse the repository at this point in the history
Also bumps the Kotlin version to 1.3.61
  • Loading branch information
thagikura authored Jan 17, 2020
1 parent a86c232 commit 4f317e9
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ buildscript {
androidxPreferenceVersion = "1.1.0"
androidxRecyclerViewVersion = "1.1.0"
androidxEspressoVersion = "3.2.0"
androidxTestExtVersion = "1.1.1"
androidxTestVersion = "1.2.0"
junitVersion = "4.12"
gradleBintrayPluginVersion = "1.6"
kotlinVersion = "1.3.50"
kotlinVersion = "1.3.61"
materialVersion = "1.0.0"
}

Expand Down
1 change: 1 addition & 0 deletions flexbox/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ dependencies {
androidTestImplementation "androidx.core:core:${rootProject.androidxCoreVersion}"
androidTestImplementation "androidx.recyclerview:recyclerview:${rootProject.androidxRecyclerViewVersion}"
androidTestImplementation "androidx.annotation:annotation:${rootProject.androidxAnnotationVersion}"
androidTestImplementation "androidx.test.ext:junit:${rootProject.androidxTestExtVersion}"
androidTestImplementation "androidx.test:runner:${rootProject.androidxTestVersion}"
androidTestImplementation "androidx.test:rules:${rootProject.androidxTestVersion}"
androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.androidxEspressoVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import androidx.core.widget.CompoundButtonCompat
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import com.google.android.flexbox.test.FlexboxTestActivity
import com.google.android.flexbox.test.IsEqualAllowingError.Companion.isEqualAllowingError
import org.hamcrest.Matchers.`is`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,29 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.annotation.LayoutRes
import androidx.core.content.res.ResourcesCompat
import androidx.test.InstrumentationRegistry
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewAssertion
import androidx.test.espresso.assertion.PositionAssertions.*
import androidx.test.espresso.assertion.PositionAssertions.isBottomAlignedWith
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyAbove
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyBelow
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyLeftOf
import androidx.test.espresso.assertion.PositionAssertions.isCompletelyRightOf
import androidx.test.espresso.assertion.PositionAssertions.isLeftAlignedWith
import androidx.test.espresso.assertion.PositionAssertions.isRightAlignedWith
import androidx.test.espresso.assertion.PositionAssertions.isTopAlignedWith
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.FlakyTest
import androidx.test.filters.MediumTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import com.google.android.flexbox.*
import com.google.android.flexbox.AlignContent
import com.google.android.flexbox.AlignItems
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
import com.google.android.flexbox.FlexboxLayout
import com.google.android.flexbox.JustifyContent
import com.google.android.flexbox.test.IsEqualAllowingError.Companion.isEqualAllowingError
import org.hamcrest.Description
import org.hamcrest.TypeSafeMatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,33 @@ import android.widget.TextView
import androidx.core.content.res.ResourcesCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.test.InstrumentationRegistry
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.*
import androidx.test.espresso.action.CoordinatesProvider
import androidx.test.espresso.action.GeneralLocation
import androidx.test.espresso.action.GeneralSwipeAction
import androidx.test.espresso.action.Press
import androidx.test.espresso.action.Swipe
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.FlakyTest
import androidx.test.filters.MediumTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import com.google.android.flexbox.*
import com.google.android.flexbox.AlignItems
import com.google.android.flexbox.AlignSelf
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
import com.google.android.flexbox.FlexboxItemDecoration
import com.google.android.flexbox.FlexboxItemDecoration.HORIZONTAL
import com.google.android.flexbox.FlexboxItemDecoration.VERTICAL
import com.google.android.flexbox.FlexboxLayoutManager
import com.google.android.flexbox.JustifyContent
import com.google.android.flexbox.test.IsEqualAllowingError.Companion.isEqualAllowingError
import org.hamcrest.Matchers.*
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.instanceOf
import org.hamcrest.Matchers.lessThan
import org.hamcrest.Matchers.notNullValue
import org.hamcrest.core.IsNot.not
import org.junit.Assert.assertThat
import org.junit.Assert.assertTrue
Expand Down Expand Up @@ -2808,7 +2821,7 @@ class FlexboxLayoutManagerTest {
// https://github.com/google/flexbox-layout/issues/208, the width of the inner
// RecyclerViews were set to 0.
val activity = activityRule.activity
val outerLayoutManager = androidx.recyclerview.widget.LinearLayoutManager(activity)
val outerLayoutManager = LinearLayoutManager(activity)

// Give the inner adapter item count enough so that inner RecyclerView with
// FlexboxLayoutManager wraps its items
Expand All @@ -2818,7 +2831,7 @@ class FlexboxLayoutManagerTest {
activityRule.runOnUiThread {
activity.setContentView(R.layout.recyclerview)
val recyclerView = activity.findViewById<RecyclerView>(R.id.recyclerview)
outerLayoutManager.orientation = androidx.recyclerview.widget.LinearLayoutManager.HORIZONTAL
outerLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
recyclerView.layoutManager = outerLayoutManager
recyclerView.adapter = adapter
}
Expand Down

0 comments on commit 4f317e9

Please sign in to comment.