OSDN Git Service

Migrate system/extras to androidx.test
authorBrett Chabot <brettchabot@google.com>
Thu, 20 Dec 2018 20:19:58 +0000 (12:19 -0800)
committerBrett Chabot <brettchabot@google.com>
Thu, 20 Dec 2018 20:36:33 +0000 (12:36 -0800)
See go/jetpack-test-android-migration

Test: compile
Change-Id: I0549a1fc80de5c66b00bdf685c536f01e7c3ae65

simpleperf/demo/SimpleperfExampleOfKotlin/app/build.gradle
simpleperf/demo/SimpleperfExamplePureJava/app/build.gradle
simpleperf/demo/SimpleperfExamplePureJava/app/src/androidTest/java/com/example/simpleperf/simpleperfexamplepurejava/ExampleInstrumentedTest.java
simpleperf/demo/SimpleperfExampleWithNative/app/build.gradle
simpleperf/demo/SimpleperfExampleWithNative/app/src/androidTest/java/com/example/simpleperf/simpleperfexamplewithnative/ExampleInstrumentedTest.java
simpleperf/scripts/app_profiler.py

index aa37a5b..132e64b 100644 (file)
@@ -15,7 +15,7 @@ android {
         targetSdkVersion 26
         versionCode 1
         versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
         release {
@@ -27,7 +27,7 @@ android {
 
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
+    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
         exclude group: 'com.android.support', module: 'support-annotations'
     })
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
index e6b73d7..0dcc199 100644 (file)
@@ -11,7 +11,7 @@ android {
         targetSdkVersion 25
         versionCode 1
         versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
         release {
@@ -23,7 +23,7 @@ android {
 
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
+    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
         exclude group: 'com.android.support', module: 'support-annotations'
     })
     implementation 'com.android.support:appcompat-v7:25.3.1'
index e4c2791..cb91806 100644 (file)
@@ -1,14 +1,15 @@
 package com.example.simpleperf.simpleperfexamplepurejava;
 
+import static org.junit.Assert.*;
+
 import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.*;
-
 /**
  * Instrumentation test, which will execute on an Android device.
  *
index b85b30f..4636e64 100644 (file)
@@ -11,7 +11,7 @@ android {
         targetSdkVersion 25
         versionCode 1
         versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         externalNativeBuild {
             cmake {
                 cppFlags "-std=c++11"
@@ -34,7 +34,7 @@ android {
 dependencies {
     implementation 'com.android.support.constraint:constraint-layout:1.0.2'
     implementation fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
+    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
         exclude group: 'com.android.support', module: 'support-annotations'
     })
     implementation 'com.android.support:appcompat-v7:25.3.1'
index 3b21b44..fffff66 100644 (file)
@@ -1,14 +1,15 @@
 package com.example.simpleperf.simpleperfexamplewithnative;
 
+import static org.junit.Assert.*;
+
 import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.*;
-
 /**
  * Instrumentation test, which will execute on an Android device.
  *
index 546b614..e45580a 100755 (executable)
@@ -304,7 +304,7 @@ class AppProfiler(ProfilerBase):
             log_exit("Can't start activity %s" % activity)
 
     def start_test(self):
-        runner = self.args.app + '/android.support.test.runner.AndroidJUnitRunner'
+        runner = self.args.app + '/androidx.test.runner.AndroidJUnitRunner'
         result = self.adb.run(['shell', 'am', 'instrument', '-e', 'class',
                                self.args.test, runner])
         if not result: