tags:

views:

17

answers:

2

Hi All

I am quite new to Android and Java I am looking for example of how to use this class:

SingleLaunchActivityTestCase

Till now I am using class InstrumentationTestCase but the problem is that for each launched test case Android calling onSetup() and TearDown()

Need help urgently

A: 

Looking at the documentation of those two classes, it looks like the SingleLaunchActivityTestCase is a wrapper class for InstrumentationTestCase. You should be able to use it the same way as you use InstrumentationTestCase; the only difference is in the constructor.

According to the documentation, you need the package name and the class type of the activity. A typical example of this might be:

SingleLaunchActivityTestCase myTestCase;
myTestCase = new SingleLaunchActivityTestCase("com.mycompany.myproject", MyActivity.class);
iandisme
A: 

Hi iandisme Thanks for your answer

What should I write instead of MyActivity ?? Sorry for dump question, but I do not have activity or at least that what I think so

My class extends from InstrumentationTestCase (that doesn't in turn sxtend from Activity class)

my manifest is:

?xml version="1.0" encoding="utf-8"?>

manifest xmlns:android="http://schemas.android.com/apk/res/android"

      package="com.android.phonetests"

   android:sharedUserId="android.uid.myphonetest">  

application>

/application>

instrumentation android:name=".PhoneInstrumentationTestRunner"

   android:targetPackage="com.android.phone"

   android:label="Test runner for all the Phone tests 

that are instrumented.">

/instrumentation>

/manifest>

ilana