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
getting

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 .


package com.android.myservice.test;

import com.android.myservice.MockActivity;

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

public class TestCaseOne extends
ActivityInstrumentationTestCase2<MockActivity> {

        public TestCaseOne(String pkg, Class<MockActivity> activityClass) {
                super("com.android.myservice.test", 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
ActivityInstrumenationTestCase2.

--



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.

Joe




--


Sponsored Links


Other Threads

1. How to build android

You will find the mailing lists much more useful than emailing individuals.

http://source.android.com/discuss

As I said on the mailing list, where I assume you got my email, I
bailed out on CentOS and used Ubuntu instead.




--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: 

2. Add your application to Android Market for FREE!

Hello fellow Android developers!

To motivate developers to spread their applications for the Android
mobile platform, we decided to offer FREE INCLUSION of their
applications into Android Market!

Normally, to participate in the Android Market program, every
developer should sign up and pay a fee of $25. There are developers
out there, who cannot afford this. We want to HELP this group of
developers to spread their applications to the World!

Moreover, if your application is a freeware, then we will also add it
to our Android Freeware Directory at http://www.androidfreeware.org/

All you need to do to submit your app is to send an email at
[EMAIL PROTECTED] In your email please include:
1) Short description of the application
2) Signed APK file (if it's not signed we'll sign it ourselves with a
generic certificate)
3) Name of the author.

Your application will be distributed to Android Market from our
account, but in the description we will provide AUTHOR'S CREDENTIALS!
All comments and emails related to your application from Android
Market users WILL BE FORWARDED to your email address automatically.

If you are interested in this program please contact us at
[EMAIL PROTECTED]

PS: Please, don't try to abuse our offer. All applications will be
tested against malware before they go to the Market.

PPS: Cross-posted to "Android Developers"

Regards,
SFD Team
--~--~---------~--~----~------------~-------~--~----~

3. How to Handle Delays/Waits

4. Unable to record using MediaRecorder

5. How to show the position in a MapView in SDK 1.

6. shared preferences between applications

7. Problem with Service Permission