This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final class OrchestratedInstrumentationListener extends RunListener { | |
| ... | |
| OrchestratorCallback odoCallback; | |
| ... | |
| public void addTests(Description description) { | |
| if (description.isTest()) { | |
| String var2 = description.getClassName(); | |
| String var3 = description.getMethodName(); | |
| this.addTest((new StringBuilder(1 + String.valueOf(var2).length() + String.valueOf(var3).length())).append(var2).append("#").append(var3).toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onStart() { | |
| setJsBridgeClassName("android.support.test.espresso.web.bridge.JavaScriptBridge"); | |
| super.onStart(); | |
| /* | |
| * The orchestrator cannot collect the list of tests as it is running in a different process | |
| * than the test app. On first run, the Orchestrator will ask AJUR to list the tests | |
| * out that would be run for a given class parameter. AJUR will then be successively | |
| * called with whatever it passes back to the orchestratorListener. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android { | |
| defaultConfig { | |
| ... | |
| testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
| } | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 02/26 17:18:09: Launching All Tests | |
| $ adb push .../build/outputs/apk/debug/app-debug.apk /data/local/tmp/com.foo.bar | |
| $ adb shell pm install -t -r "/data/local/tmp/com.foo.bar" | |
| Success | |
| $ adb push .../build/outputs/apk/androidTest/debug/app-debug-androidTest.apk /data/local/tmp/com.foo.bar.test | |
| $ adb shell pm install -t -r "/data/local/tmp/com.foo.bar.test" | |
| Success | |
| $ adb push /Users/piotr/.gradle/caches/modules-2/files-2.1/com.android.support.test/orchestrator/1.0.1/12d61be26b643c6413d207248660bce8f6d8b236/orchestrator-1.0.1.apk /data/local/tmp/android.support.test.orchestrator | |
| $ adb shell pm install -t -r "/data/local/tmp/android.support.test.orchestrator" | |
| Success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| adb shell 'CLASSPATH=$(pm path android.support.test.services) app_process / \ | |
| android.support.test.services.shellexecutor.ShellMain am instrument -w -e -v \ | |
| targetInstrumentation com.foo.bar/android.support.test.runner.AndroidJUnitRunner \ | |
| android.support.test.orchestrator/.AndroidTestOrchestrator' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android { | |
| defaultConfig { | |
| ... | |
| testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
| } | |
| testOptions { | |
| execution 'ANDROID_TEST_ORCHESTRATOR' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.stepstone.base.test.runner; | |
| import android.os.Bundle; | |
| import android.support.test.runner.AndroidJUnitRunner; | |
| import com.stepstone.base.test.runner.filter.FlavorFilter; | |
| public class MyAndroidJUnitRunner extends AndroidJUnitRunner { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.stepstone.base.test.runner.filter | |
| import org.junit.runner.Description | |
| import org.junit.runner.manipulation.Filter | |
| /** | |
| * Helper parent class for [Filter] that allows suites to run if any child matches. | |
| */ | |
| abstract class ParentFilter : Filter() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.stepstone.base.test.runner.annotation | |
| /** | |
| * Used for narrowing down on which brands any given test/test suite should be executed. | |
| * | |
| * @see com.stepstone.base.test.runner.filter.FlavorFilter | |
| */ | |
| @Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS) | |
| @Retention(AnnotationRetention.RUNTIME) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.stepstone.base.test.runner.filter | |
| import android.os.Bundle | |
| import com.stepstone.base.BuildConfig | |
| import com.stepstone.base.test.runner.annotation.TestFilter | |
| import org.junit.runner.Description | |
| import timber.log.Timber | |
| /** |