¡@

Home 

2014/10/16 ¤W¤È 08:16:04

android Programming Glossary: instrumentation

Android Eclipse Plugin: Instrumentation Test Runner not specified

http://stackoverflow.com/questions/1009970/android-eclipse-plugin-instrumentation-test-runner-not-specified

does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses library android.test.runner Google..

how to pass an argument to a android junit test (Parameterized tests)

http://stackoverflow.com/questions/14820175/how-to-pass-an-argument-to-a-android-junit-test-parameterized-tests

1 android versionName 1.0 uses sdk android minSdkVersion 5 instrumentation android name android.test.InstrumentationTestRunner android.. myarg public String getArgument return mArgument Add the instrumentation to AndroidManifest.xml in your case instrumentation android.. the instrumentation to AndroidManifest.xml in your case instrumentation android name com.example.my.test.MyTestRunner android targetPackage..

How do you test an Android application across multiple Activities?

http://stackoverflow.com/questions/1759626/how-do-you-test-an-android-application-across-multiple-activities

public void testAValidUserCanLogIn Instrumentation instrumentation getInstrumentation Register we are interested in the authentication.. activiry... Instrumentation.ActivityMonitor monitor instrumentation.addMonitor AuthenticateActivity.class.getName null false Start.. Intent.FLAG_ACTIVITY_NEW_TASK intent.setClassName instrumentation.getTargetContext AuthenticateActivity.class.getName instrumentation.startActivitySync..

What can you not do on the Dalvik VM (Android's VM) that you can in Sun VM?

http://stackoverflow.com/questions/230193/what-can-you-not-do-on-the-dalvik-vm-androids-vm-that-you-can-in-sun-vm

On the other hand AspectJ should work as it uses bytecode instrumentation as a compilation step though I dunno if anyone tried . As to.. compiles to standard bytecode and does not use bytecode instrumentation at runtime can be converted to Dalvik and should work. I know..

Can't build and run an android test project created using “ant create test-project” when tested project has jars in libs directory

http://stackoverflow.com/questions/2472059/cant-build-and-run-an-android-test-project-created-using-ant-create-test-proje

How to use EMMA code coverage in android

http://stackoverflow.com/questions/2762665/how-to-use-emma-code-coverage-in-android

this in the dev guide where they tell you about the EMMA instrumentation options. http developer.android.com guide developing testing..

How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command

http://stackoverflow.com/questions/3228245/how-can-i-deliver-parameters-to-a-test-function-that-launched-using-adb-shell-a

command I am developing in Android I am using instrumentation to test Phone application. Instrumentation is Android env to.. by the am command. Is it possible Please help android instrumentation share improve this question you can pass a data uri mime..

Mocking library/framework that works best in Android?

http://stackoverflow.com/questions/3337505/mocking-library-framework-that-works-best-in-android

mock. However you can still use mocking libraries in non instrumentation tests i.e. in your standard unit tests executed on the JVM... class from which we inherit every normal JUnit test. For instrumentation tests we create custom mock classes and decide using a factory..

Trying to run trivial Android JUnit tests. Getting: “Test run failed: No test results” What am I missing?

http://stackoverflow.com/questions/3462850/trying-to-run-trivial-android-junit-tests-getting-test-run-failed-no-test-re

1 But I get the following in the Console Launching instrumentation android.test.InstrumentationTestRunner on device emulator 5554..

How to compile Android Application with system permissions

http://stackoverflow.com/questions/3598662/how-to-compile-android-application-with-system-permissions

error message Test run failed Permission Denial starting instrumentation ComponentInfo com.jayway.test android.test.InstrumentationTestRunner..

Static references are cleared--does Android unload classes at runtime if unused?

http://stackoverflow.com/questions/5105097/static-references-are-cleared-does-android-unload-classes-at-runtime-if-unused

app run just in the main application thread but in an instrumentation test run where objects get replaced with mocks I write it from.. where objects get replaced with mocks I write it from the instrumentation thread and read it on the UI thread. I could have as well synchronized..

Why does AndroidTestCase.getContext().getApplicationContext() return null?

http://stackoverflow.com/questions/6516441/why-does-androidtestcase-getcontext-getapplicationcontext-return-null

like Activity are initialized by the main thread. Your instrumentation thread is running at the same time those are initializing. This..

test if a button starts a new activity in android junit (pref without robotium)?

http://stackoverflow.com/questions/9405561/test-if-a-button-starts-a-new-activity-in-android-junit-pref-without-robotium

it helps you moniotor newly opened activity during instrumentation check out the pseudo code below public void testOpenNextActivity..

Android Eclipse Plugin: Instrumentation Test Runner not specified

http://stackoverflow.com/questions/1009970/android-eclipse-plugin-instrumentation-test-runner-not-specified

Eclipse Plugin Instrumentation Test Runner not specified I'm getting this error when trying.. tests from Eclipse with an Android Project. The list of Instrumentation Test Runners is empty in the Android preferences. 2009 06 17.. 51 MyApp ERROR Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses library android.test.runner..

Simulating power button press to display switch off dialog box

http://stackoverflow.com/questions/11338022/simulating-power-button-press-to-display-switch-off-dialog-box

ERROR e.toString e.printStackTrace Third approach Instrumentation inst new Instrumentation inst.sendKeyDownUpSync KeyEvent.KEYCODE_POWER.. Third approach Instrumentation inst new Instrumentation inst.sendKeyDownUpSync KeyEvent.KEYCODE_POWER Fourth approach..

how to generate zoom/pinch gesture for testing for Android

http://stackoverflow.com/questions/11523423/how-to-generate-zoom-pinch-gesture-for-testing-for-android

we need four points coordinations start0 start1 end0 end1 Instrumentation inst action down event MotionEvent event MotionEvent.obtain.. the zoom gesture public static void generateZoomGesture Instrumentation inst long startTime boolean ifMove GestureInfo.Point startPoint1..

how to pass an argument to a android junit test (Parameterized tests)

http://stackoverflow.com/questions/14820175/how-to-pass-an-argument-to-a-android-junit-test-parameterized-tests

Edit I am using Robotium and the junit extends ActivityInstrumentationTestCase2 See below the very basic junit test import android.test.ActivityInstrumentationTestCase2.. the very basic junit test import android.test.ActivityInstrumentationTestCase2 import android.util.Log import com.jayway.android.robotium.solo.Solo.. public class Test_arg extends ActivityInstrumentationTestCase2 private static final String TARGET_PACKAGE_ID com.myapp.test..

How do you test an Android application across multiple Activities?

http://stackoverflow.com/questions/1759626/how-do-you-test-an-android-application-across-multiple-activities

with the test APIs that come with Android e.g. ActivityInstrumentationTestCase2 and also with Positron but neither seem capable of.. static com.mycompany.R.id. public class LoginTests extends InstrumentationTestCase @MediumTest public void testAValidUserCanLogIn Instrumentation.. @MediumTest public void testAValidUserCanLogIn Instrumentation instrumentation getInstrumentation Register we are interested..

GUI testing with Instrumentation in Android

http://stackoverflow.com/questions/2673746/gui-testing-with-instrumentation-in-android

testing with Instrumentation in Android I want to test my Android applications UI with keyevents.. buttons and so on. I've read som documentation that Instrumentation would be able to use for this purpose. Anyone with expericence.. use for this purpose. Anyone with expericence with using Instrumentation for UI testing android gui testing user interface instrumentation..

How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command

http://stackoverflow.com/questions/3228245/how-can-i-deliver-parameters-to-a-test-function-that-launched-using-adb-shell-a

to a test function that launched using adb shell am Instrumentation command I am developing in Android I am using instrumentation.. I am using instrumentation to test Phone application. Instrumentation is Android env to test applications. For that I use am command..

What is the Android UiThread (UI thread)

http://stackoverflow.com/questions/3652560/what-is-the-android-uithread-ui-thread

here I personally only use the RunOnUiThread method in my Instrumentation Tests. Since the test code does not execute in the UIThread..

android classcastexception on activity startup

http://stackoverflow.com/questions/3838640/android-classcastexception-on-activity-startup

ActivityThread PackageInfo.makeApplication boolean Instrumentation line 649 ActivityThread.handleBindApplication ActivityThread..

Why does AndroidTestCase.getContext().getApplicationContext() return null?

http://stackoverflow.com/questions/6516441/why-does-androidtestcase-getcontext-getapplicationcontext-return-null

unit testing junit context share improve this question Instrumentation runs in a separate thread from the main app thread so that it.. need to synchronize with the main thread use for example Instrumentation.waitForIdleSync In particular the Application object as well.. probably have such code run on the main thread such as via Instrumentation.runOnMainSync java.lang.Runnable share improve this answer..

How to start and stop android service from a adb shell?

http://stackoverflow.com/questions/7415997/how-to-start-and-stop-android-service-from-a-adb-shell

send a broadcast Intent am broadcast INTENT start an Instrumentation am instrument flags COMPONENT r print raw results otherwise..

NoClassDefFoundError when running Instrumentation test with ant

http://stackoverflow.com/questions/9847443/noclassdeffounderror-when-running-instrumentation-test-with-ant

when running Instrumentation test with ant This is an Android SDK tools v17 problem. Expect..

Android Eclipse Plugin: Instrumentation Test Runner not specified

http://stackoverflow.com/questions/1009970/android-eclipse-plugin-instrumentation-test-runner-not-specified

preferences. 2009 06 17 23 57 51 MyApp ERROR Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses library android.test.runner Google fu failing me. It's also annoyingly decided that because I tried..

how to pass an argument to a android junit test (Parameterized tests)

http://stackoverflow.com/questions/14820175/how-to-pass-an-argument-to-a-android-junit-test-parameterized-tests

apk res android package com.myapp.test android versionCode 1 android versionName 1.0 uses sdk android minSdkVersion 5 instrumentation android name android.test.InstrumentationTestRunner android targetPackage com.slacker.radio android functionalTest true.. arguments if arguments null mArgument arguments.getString myarg public String getArgument return mArgument Add the instrumentation to AndroidManifest.xml in your case instrumentation android name com.example.my.test.MyTestRunner android targetPackage.. myarg public String getArgument return mArgument Add the instrumentation to AndroidManifest.xml in your case instrumentation android name com.example.my.test.MyTestRunner android targetPackage com.slacker.radio android functionalTest true and..

How do you test an Android application across multiple Activities?

http://stackoverflow.com/questions/1759626/how-do-you-test-an-android-application-across-multiple-activities

public class LoginTests extends InstrumentationTestCase @MediumTest public void testAValidUserCanLogIn Instrumentation instrumentation getInstrumentation Register we are interested in the authentication activiry... Instrumentation.ActivityMonitor monitor.. Register we are interested in the authentication activiry... Instrumentation.ActivityMonitor monitor instrumentation.addMonitor AuthenticateActivity.class.getName null false Start the authentication activity as the first activity... Intent.. Intent intent new Intent Intent.ACTION_MAIN intent.setFlags Intent.FLAG_ACTIVITY_NEW_TASK intent.setClassName instrumentation.getTargetContext AuthenticateActivity.class.getName instrumentation.startActivitySync intent Wait for it to start... Activity..

What can you not do on the Dalvik VM (Android's VM) that you can in Sun VM?

http://stackoverflow.com/questions/230193/what-can-you-not-do-on-the-dalvik-vm-androids-vm-that-you-can-in-sun-vm

Google Guice though I am sure some people work on that . On the other hand AspectJ should work as it uses bytecode instrumentation as a compilation step though I dunno if anyone tried . As to other jvm languages anything that in the end compiles to standard.. tried . As to other jvm languages anything that in the end compiles to standard bytecode and does not use bytecode instrumentation at runtime can be converted to Dalvik and should work. I know people did run Jython on Android and it worked ok. Other thing..

Can't build and run an android test project created using “ant create test-project” when tested project has jars in libs directory

http://stackoverflow.com/questions/2472059/cant-build-and-run-an-android-test-project-created-using-ant-create-test-proje

How to use EMMA code coverage in android

http://stackoverflow.com/questions/2762665/how-to-use-emma-code-coverage-in-android

the source tree. Which seems weird because they don't mention this in the dev guide where they tell you about the EMMA instrumentation options. http developer.android.com guide developing testing testing_otheride.html#AMOptionsSyntax You can read the response..

How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command

http://stackoverflow.com/questions/3228245/how-can-i-deliver-parameters-to-a-test-function-that-launched-using-adb-shell-a

to a test function that launched using adb shell am Instrumentation command I am developing in Android I am using instrumentation to test Phone application. Instrumentation is Android env to test applications. For that I use am command with name of test.. I mean that I wish to deliver parameters to the test launched by the am command. Is it possible Please help android instrumentation share improve this question you can pass a data uri mime type and even extras to the am command. am start instrument..

Mocking library/framework that works best in Android?

http://stackoverflow.com/questions/3337505/mocking-library-framework-that-works-best-in-android

have to subclass them and override the methods you want to mock. However you can still use mocking libraries in non instrumentation tests i.e. in your standard unit tests executed on the JVM. You can use PowerMock to mock framework methods it has support.. and mock out classes like Context and TextUtils in a base class from which we inherit every normal JUnit test. For instrumentation tests we create custom mock classes and decide using a factory which implementation mock or not to instantiate at runtime...

Trying to run trivial Android JUnit tests. Getting: “Test run failed: No test results” What am I missing?

http://stackoverflow.com/questions/3462850/trying-to-run-trivial-android-junit-tests-getting-test-run-failed-no-test-re

.. stdout Time 0.07 stdout OK 2 tests stdout INSTRUMENTATION_CODE 1 But I get the following in the Console Launching instrumentation android.test.InstrumentationTestRunner on device emulator 5554 Collecting test information Test run failed No test results..

How to compile Android Application with system permissions

http://stackoverflow.com/questions/3598662/how-to-compile-android-application-with-system-permissions

For now while I try to run my apk I get the error message Test run failed Permission Denial starting instrumentation ComponentInfo com.jayway.test android.test.InstrumentationTestRunner from pid 354 uid 354 not allowed because package com.jayway.test..

Static references are cleared--does Android unload classes at runtime if unused?

http://stackoverflow.com/questions/5105097/static-references-are-cleared-does-android-unload-classes-at-runtime-if-unused

reading that reference from more than one thread In an ordinary app run just in the main application thread but in an instrumentation test run where objects get replaced with mocks I write it from the instrumentation thread and read it on the UI thread... main application thread but in an instrumentation test run where objects get replaced with mocks I write it from the instrumentation thread and read it on the UI thread. I could have as well synchronized the call to getInstance but that's more expensive..

Why does AndroidTestCase.getContext().getApplicationContext() return null?

http://stackoverflow.com/questions/6516441/why-does-androidtestcase-getcontext-getapplicationcontext-return-null

the Application object as well as all other top level classes like Activity are initialized by the main thread. Your instrumentation thread is running at the same time those are initializing. This if you are touching any of those objects and are not implementing..

test if a button starts a new activity in android junit (pref without robotium)?

http://stackoverflow.com/questions/9405561/test-if-a-button-starts-a-new-activity-in-android-junit-pref-without-robotium

junit share improve this question You need ActivityMonitor it helps you moniotor newly opened activity during instrumentation check out the pseudo code below public void testOpenNextActivity register next activity that need to be monitored. ActivityMonitor..

Android Eclipse Plugin: Instrumentation Test Runner not specified

http://stackoverflow.com/questions/1009970/android-eclipse-plugin-instrumentation-test-runner-not-specified

Eclipse Plugin Instrumentation Test Runner not specified I'm getting this error when trying to run unit tests from Eclipse with an Android Project. The.. not specified I'm getting this error when trying to run unit tests from Eclipse with an Android Project. The list of Instrumentation Test Runners is empty in the Android preferences. 2009 06 17 23 57 51 MyApp ERROR Application does not specify a android.test.InstrumentationTestRunner.. is empty in the Android preferences. 2009 06 17 23 57 51 MyApp ERROR Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses library android.test.runner Google fu failing me. It's also annoyingly..

Simulating power button press to display switch off dialog box

http://stackoverflow.com/questions/11338022/simulating-power-button-press-to-display-switch-off-dialog-box

catch RemoteException e TODO Auto generated catch block Log.e ERROR e.toString e.printStackTrace Third approach Instrumentation inst new Instrumentation inst.sendKeyDownUpSync KeyEvent.KEYCODE_POWER Fourth approach try long now SystemClock.uptimeMillis.. TODO Auto generated catch block Log.e ERROR e.toString e.printStackTrace Third approach Instrumentation inst new Instrumentation inst.sendKeyDownUpSync KeyEvent.KEYCODE_POWER Fourth approach try long now SystemClock.uptimeMillis KeyEvent down..

how to generate zoom/pinch gesture for testing for Android

http://stackoverflow.com/questions/11523423/how-to-generate-zoom-pinch-gesture-for-testing-for-android

method Here is my implementation enter code here for zoom we need four points coordinations start0 start1 end0 end1 Instrumentation inst action down event MotionEvent event MotionEvent.obtain downTime eventTime MotionEvent.ACTION_DOWN 1 prop_start0 pointerCoords_start0.. of each touch point to 1. Here is the example to generate the zoom gesture public static void generateZoomGesture Instrumentation inst long startTime boolean ifMove GestureInfo.Point startPoint1 GestureInfo.Point startPoint2 GestureInfo.Point endPoint1..

how to pass an argument to a android junit test (Parameterized tests)

http://stackoverflow.com/questions/14820175/how-to-pass-an-argument-to-a-android-junit-test-parameterized-tests

a quick and easy example it would be very appreciated. Thanks Edit I am using Robotium and the junit extends ActivityInstrumentationTestCase2 See below the very basic junit test import android.test.ActivityInstrumentationTestCase2 import android.util.Log.. and the junit extends ActivityInstrumentationTestCase2 See below the very basic junit test import android.test.ActivityInstrumentationTestCase2 import android.util.Log import com.jayway.android.robotium.solo.Solo public class Test_arg extends ActivityInstrumentationTestCase2.. import android.util.Log import com.jayway.android.robotium.solo.Solo public class Test_arg extends ActivityInstrumentationTestCase2 private static final String TARGET_PACKAGE_ID com.myapp.test private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME..

How do you test an Android application across multiple Activities?

http://stackoverflow.com/questions/1759626/how-do-you-test-an-android-application-across-multiple-activities

find ourselves back on the main menu or logged out. We've toyed with the test APIs that come with Android e.g. ActivityInstrumentationTestCase2 and also with Positron but neither seem capable of testing beyond the bounds of a single Activity and while we.. import static org.junit.Assert. import static com.mycompany.R.id. public class LoginTests extends InstrumentationTestCase @MediumTest public void testAValidUserCanLogIn Instrumentation instrumentation getInstrumentation Register we are.. public class LoginTests extends InstrumentationTestCase @MediumTest public void testAValidUserCanLogIn Instrumentation instrumentation getInstrumentation Register we are interested in the authentication activiry... Instrumentation.ActivityMonitor..

GUI testing with Instrumentation in Android

http://stackoverflow.com/questions/2673746/gui-testing-with-instrumentation-in-android

testing with Instrumentation in Android I want to test my Android applications UI with keyevents and pressed buttons and so on. I've read som documentation.. want to test my Android applications UI with keyevents and pressed buttons and so on. I've read som documentation that Instrumentation would be able to use for this purpose. Anyone with expericence with using Instrumentation for UI testing android gui testing.. read som documentation that Instrumentation would be able to use for this purpose. Anyone with expericence with using Instrumentation for UI testing android gui testing user interface instrumentation share improve this question The officially recommended..

How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command

http://stackoverflow.com/questions/3228245/how-can-i-deliver-parameters-to-a-test-function-that-launched-using-adb-shell-a

can I deliver parameters to a test function that launched using adb shell am Instrumentation command I am developing in Android I am using instrumentation to test Phone application. Instrumentation is Android env.. adb shell am Instrumentation command I am developing in Android I am using instrumentation to test Phone application. Instrumentation is Android env to test applications. For that I use am command with name of test case. I run adb then I enter adb shell..

What is the Android UiThread (UI thread)

http://stackoverflow.com/questions/3652560/what-is-the-android-uithread-ui-thread

spawning worker threads and updating the UI from them click here I personally only use the RunOnUiThread method in my Instrumentation Tests. Since the test code does not execute in the UIThread you need to use this method to run code that modifies the UI...

android classcastexception on activity startup

http://stackoverflow.com/questions/3838640/android-classcastexception-on-activity-startup

the stacktrace Thread 1 main Suspended exception RuntimeException ActivityThread PackageInfo.makeApplication boolean Instrumentation line 649 ActivityThread.handleBindApplication ActivityThread AppBindData line 4232 ActivityThread.access 3000 ActivityThread..

Why does AndroidTestCase.getContext().getApplicationContext() return null?

http://stackoverflow.com/questions/6516441/why-does-androidtestcase-getcontext-getapplicationcontext-return-null

or contributor yet maybe this is a good time. android unit testing junit context share improve this question Instrumentation runs in a separate thread from the main app thread so that it can execute without blocking or disrupting or being blocked.. or disrupting or being blocked by the main thread. If you need to synchronize with the main thread use for example Instrumentation.waitForIdleSync In particular the Application object as well as all other top level classes like Activity are initialized..

How to start and stop android service from a adb shell?

http://stackoverflow.com/questions/7415997/how-to-start-and-stop-android-service-from-a-adb-shell

for launch to complete start a Service am startservice INTENT send a broadcast Intent am broadcast INTENT start an Instrumentation am instrument flags COMPONENT r print raw results otherwise decode REPORT_KEY_STREAMRESULT e NAME VALUE set argument NAME..

NoClassDefFoundError when running Instrumentation test with ant

http://stackoverflow.com/questions/9847443/noclassdeffounderror-when-running-instrumentation-test-with-ant

when running Instrumentation test with ant This is an Android SDK tools v17 problem. Expect a fix in v18 I have a test target project A and a tester..