Problem in running test case

by Siddharth Choudhary » Wed, 20 Oct 2010 17:23:48 GMT

Sponsored Links
 Hello ,

I am working on android automation ,and i am new to this field , i
went through the test example available at developer site and i am

11-05 14:43:14.509: WARN/TestGrouping(1485): Invalid Package: '' could
not be found or has no tests

as  error on running  this code .



import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;

public class TestCaseOne extends
ActivityInstrumentationTestCase2<MockActivity> {

        public TestCaseOne(String pkg, Class<MockActivity> activityClass) {
                super("", MockActivity.class);

        public void test001case()
                Log.e("", "test case 001");

But when i extend this class with InstrumentationTestCase then this
code work's fine please let me know what mistake am i  doing in using


Problem in running test case

by A. Elk » Fri, 22 Oct 2010 00:22:55 GMT

 This class looks OK to me, with one possible exception that I'll
mention at the end.

You didn't post the manifest file for this test package. The problem
might be there.

You said "when I extend this class with InstrumentationTestCase..."
Can you post exactly what you mean? Which class is "this" class? You
should not have to extend TestCaseOne with *both*
ActivityInstrumentationTestCase2 *and* InstrumentationTestCase, since
ActivityInstrumentationTestCase2 itself extends
InstrumentationTestCase. So please clarify what you mean.

One off-the-wall thought: Your first test is named test001case(). I
know that JUnit 3 figures out which methods in a test case are tests
by looking for a prefix of "test". If it strips off the "test", the
method name that remains is 001case, and I wonder if that causes
hiccups somewhere. I try to name all my test methods with a
description of the method or operation they're testing. As an example,
to test an Activity's onPause() method I'd name the test
"testOnPause()". Try using a non-numeric name and see what happens.



Sponsored Links

Other Threads

1. OutOfMemoryError when changing screen orientation


I get an OutOfMemoryError every time i change the screen orientation
and I am having a hard time finding the mistake...

The Activitie's view consists of an ImageView, two Buttons and a
Spinner. I don't have static variables and can't imagine where i could
leak a context.

Most of the times, the exception is thrown at setContentView
sometimes it goes fine until imgUpload.setImageURI(imageURI);

The images i am displaying are form the G1's camera, so about 500kb
and 2048x1536pixels

Here is some code:
        private ImageView imgUpload;
        private Spinner spnCollections;
        private Button btnEditMetadata;
        private Button btnUpload;
        private Uri imageURI;

        public void onCreate(Bundle savedInstanceState) {

                // Get View References
                imgUpload = (ImageView) findViewById(;
                spnCollections = (Spinner)findViewById(;
                btnEditMetadata = (Button) findViewById(;
                btnUpload = (Button)findViewById(;

                // Get Image from ACTION_SEND Intent
                Intent intent = getIntent();
                if (intent.getAction() != null && intent.getAction().equals
(Intent.ACTION_SEND)) {
                        Bundle extras = intent.getExtras();
                        imageURI = 


2. what do MACRO "LOCAL_SDK_VERSION " do?

Hi All,
When I compile one example , I met with the following errors:
helloactivity/ cannot find symbol
symbol  : class ActivityManagerNative
location: package
helloactivity/ cannot find symbol
symbol  : class ServiceManager
location: package android.os
import android.os.ServiceManager;
helloactivity/ package does not exist
3 errors
make: *** [out/target/common/obj/APPS/HelloActivity_intermediates/
classes-full-debug.jar] Error 41

Finally I find if I comment out LOCAL_SDK_VERSION := current in the mk
file, then the error disappear,

Can anyone tell me why?



3. what's "/sys/class/net/ppp0/operstate"? where can i find the source code about it?

4. KeyEvent.KEYCODE_ENDCALL doesn't work

5. How to show two or more fields to list(Notepad Tutorial)?

6. sales on android - how is that going??

7. " Touch events from my PC to device using adb shell "