Sorry people I am getting the reputation of solving my own issues :).

Fixed it. I just put in a default constructor and removed moved the
initializing of myActivity to the setup. It worked.

package com.sears.android.test;


import com.my.android.myActivity;

import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;

public class TestCartView extends
                ActivityInstrumentationTestCase2<myActivity> {

        Activity myActivity ;
        public TestCartView() {
                super("com.my.android.myActivity", myActivity.class);
        }
        public TestCartView(String pkg, Class<myActivity> activityClass) {
                super(pkg, activityClass);
        }

        protected void setUp() throws Exception {
                super.setUp() ;
                myActivity = super.getActivity() ;
        }

        public void testSomethingSilly() {
                assertNotNull(myActivity) ;
        }


        public void testSomethingSillier() {
                assertNotNull(myActivity) ;
        }

        protected void tearDown() throws Exception {
                super.tearDown();
        }

}


On Jul 16, 6:16 pm, MCON Dev <[email protected]> wrote:
> Please help, I am unable to integrate Junit with Android. I am using Junit
> 3, I have also tried Junit4.
>
> *
>
> package* com.android.test;
>
>  *
>
> import* com.android.MyActivity;
>
> *
>
> import* android.app.Activity;
> *
>
> import* android.test.ActivityInstrumentationTestCase2;
>
> *
>
> public* *class* TestMyView *extends
> *
>
> ActivityInstrumentationTestCase2<MyActivity> {
>
> Activity myActivity ;
>
> *public* TestMyView(String pkg, Class<MyActivity> activityClass) {
>
> *super*(pkg, activityClass);
>
> myActivity = getActivity() ;
>
> }
>
> *protected* *void* setUp() *throws* Exception {
>
> *super*.setUp() ;
>
> }
>
> *public* *void* testSomethingSilly() {
>
> *assertNotNull*(myActivity) ;
>
> }
>
>  *public* *void* testSomethingSillier() {
>
> *assertNotNull*(myActivity) ;
>
> }
>
> *protected* *void* tearDown() *throws* Exception {
>
> *super*.tearDown();
>
>
>
> }
> }- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to