Android :: Running Android JUnit Tests With Multiple Included Auxiliary Projects

Nov 18, 2009

I cannot run android junit tests for classes sitting in main android project that implement interfaces that reside in other included projects. Depending on SDK version I get different errors: from "Test run failed:" on 1.5 and 1.6 and spurious process death to a more polite "NoClassDefFoundError" on SDK 2.0. This happens only on instantiation of classes that reside in the Android project and implement interfaces residing outside that android project. There is no problem instantiating classes that do not fall into this category (i.e. android only or library only classes).

Android project by itself works fine with these classes - it is just the test set-up doesn't and project inclusion/classpath seems to be ok. Test project includes all projects that main project includes. NoClassDefFoundError makes little sense here given that the classloader can see and instantiate classes sitting right next to the ones that do not work. Did anyone else run into this or found a way to set-up android based tests in a multi-project set-up? Below is more detailed set-up and test explanation: 1) Library project: FooLib public interface IFoo { ... }

Android :: running Android jUnit tests with multiple included auxiliary projects


Android : Compile / Running Tests By Pointing A Standard JUnit?

Aug 18, 2010

It appears that Android supports JUnit 3 out of the box.�However, I have some pre-existing JUnit 4 unit tests that I'd like to try on Android. I've tried adding the JUnit 4 jar to eclipse and compiling/ running the tests by pointing a standard JUnit run against them, but nothing seems to happen.�There's no evidence in the eclipse console or the Android emulator that any tests have been run.

Can anyone with knowledge about this subject comment?�Is it even possible to run JUnit 4 tests under Android, and if so, is there a step-by-step explanation as to how to achieve this (preferably under Jetbrains IDEA IDE, and/or Eclipse).

View 11 Replies View Related

Android :: JUNIT Tests Results From Eclipse To XML

Sep 4, 2009

How to get the junit test results from eclipse to an XML or any logfile?

View 2 Replies View Related

Android :: Context Menu Paste Command Using Droid JUnit Tests?

Nov 4, 2010

How do I go about simulating a context menu paste command using the Android JUnit tests?

View 3 Replies View Related

Android :: Failing Android JUnit Tests, Not Breaking My Ant Script Like I Expect

Jun 2, 2010

Failing JUnit tests, not breaking my Ant script like I expect?

My continuous integration server runs an Ant script, which calls something like:
/tests/ant run-tests

My JUnit tests run, but with errors:

CODE:..............

The errors are OK, but my build script keeps going (eventually publishing my broken app to my testers - bad!). What I would expect is for the instrimentaiton to throw a build error, so my continuous integration server (TeamCity in this case) realises that something has gone wrong and reports a broken build. The "failonerror" is already set in the relevant macrodef, so I'm not sure what else I can do?

View 1 Replies View Related

Android :: Running Junit Test Case For APIDemo In Eclipse?

Jan 28, 2009

I am trying to run Junit test case for the android APIDemo project under eclipse. I create an eclipse project from the APIDemo source, it compiles fine and then I did: 1. Debug->Run as Junit tests

But I get this error: 'Lanuching AllTests' has encountered a problem. Cannot connect to VM...................

View 9 Replies View Related

Android :: Running Tests In Main Thread?

Feb 19, 2010

Can someone advise the am command (for adb shell) to run junit tests in the main thread please? The following shows onStart etc running in the test runner thread. am instrument -w -e class co.uk.telesense. tests.MyTest co.uk.telesense.tests/android.test.InstrumentationTestRunner Ewan Benfield ttp://www.telesense.co .uk tel: 0845 643 5691 (+44 845 643 5691) mob: +44 (0) 77859 26477

View 2 Replies View Related

Android :: Java.lang.NoClassDefFoundError While Running JUnit Test In Netbeans

May 26, 2010

I am building an Android hello world application in Netbeans. It's building properly and I am able to run in the emulator also. But when creating and running the Junit test I get a java.lang.NoClassDefFoundError.

View 2 Replies View Related

Android :: Running Unit Tests From Command Line?

Jul 21, 2010

I'm trying to run unit tests on the android platform in accordance with tutorial. Say, for example, I want to run tests for Email application. I open /apps/Email/tests/AndroidManifest.xml file, look for the <manifest> element, and look at the package attribute, which is com.android.email.tests, and in the <instrumentation> element I look at the android:name attribute, which is android.test.InstrumentationTestRunner.

View 3 Replies View Related

Android : Multiple Instances Of Included Layout - Namespacing

Jan 12, 2010

I've been attempting to use the <include> tag in some layouts and it seems that these are of limited use because of the flat namespace of the R.id.x approach.

Suppose I have a layout (attribs and xml namespace decl omitted for clarity).

CODE:.......

Now in my java code I have a conundrum. I am not able to identify each individual instance o f the children included layouts root view. In the include tags I can replace the root id with "row1" and "row2" so I can find the individual linear layouts using findViewById

eg:

CODE:.........

However, I can't easily access the two instances of the TextView which are children of row1 and row2 because all I have to play with is the single id "text"

ie:

CODE:..........

In this case, which instance (row1.text or row2.text) does this refer to, both of them, or none?

I guess I would need to use another means of accessing the children of row1 and row2.

View 3 Replies View Related

Android :: Getting Illegal Access Error When Running Droid Tests / Why Is So?

Mar 12, 2010

I get the following stack trace when running my Android tests on the Emulator code...

I run my tests from an extra project. And it seems there are some problems with loading the classes from the other project. I have run the tests before but now they are failing. The project under tests runs without problems.

Line 14 of the Helper Class is:

this.httpHelper = new HttpHelper(userProfile);

I start a HttpHelper class that is responsible for executing httpqueries. I think somehow this helper class is not available anymore, but I have no clue why.

View 1 Replies View Related

Android :: How To Build APK From Multiple Eclipse Projects?

Nov 11, 2009

Does anyone know of suggestions/recommendations on how to structure Eclipse projects in order to build an apk from multiple projects? I would like to share classes & resources (strings, layouts, etc.) across multiple apps. How to structure Eclipse projects to do such a thing!

View 8 Replies View Related

Android :: AIDL In Multiple Projects In Eclipse

Mar 16, 2010

I have problems with the following: I want to create to applications. One with a Android service and one with a Activity that will use functions on the Service. Before I splitted this in to applications I got everything working in one application. I can call functions (that are definned in the aidl - file) on the service without problems.

Now the problems coms. I splitted the application into two parts, a Service application and Gui application. The bindins to the service (in the gui application) works and I see that the service is getting created. Then in the onServiceConnected function of the ServiceConnection class I created the following:

mService = IMyService.Stub.asInterface(service);
And this gives me the following exception:
03-16 13:53:05.549: ERROR/AndroidRuntime(881): java.lang.NoClassDefFoundError: MyPackage.IMyService$Stub

It looks like he can't find the Stub class in IMyService. But the Stub is part of the java file generated out of the aidl-file. Why I get this exception or how I can resolve this?

View 9 Replies View Related

Android :: Error Using InstrumentationTestRunner With Multiple Projects

Oct 8, 2009

My application is seperated into three projects in eclipse. The first one is a client Android Project called "Project A". The second is a server Android Project called "ProjectB". Lastly, I have "ProjectATest" for testing that has references dependencies to "ProjectA" and "ProjectB".

When excuting InstrumentationTestRunner in "ProjectATest," I get the following error message:

CODE:.........

This is the error as pulled from LogCat:

CODE:......................

View 5 Replies View Related

Android :: Reusing Java Source In Multiple Projects

Nov 24, 2009

I'm currently developing for Android using Eclipse. I have a lexicon viewer application (with package name "com.mycompany.myviewer") that I want to reuse multiple times, just changing specific resources such as app name and icons.For example, I have a certain publisher "Publisher1", who publishes the lexicons "Lexicon1" and "Lexicon2". I would need to two applications: App1 with certain name and icon, and App2 with another name and icon.What is the best way of doing this in Java? In visual Studio (and C++) I could create two projects based on the lexikon viewer app and use conditional resources to get the right name and icon. Is there some way of doing something similar in Java?

View 2 Replies View Related

Android :: How Do I Run Unit Tests / Functional Tests?

Aug 6, 2010

"Hello, World" and "Hello, Testing" tutorials I created an android application created with Eclipse, along with a corresponding Android Test Project.The tests run fine once. After that, in order for me to run the tests again, I have to close the emulator.If I don't close the emulator, the Eclipse console get stuck on "Installing instrumentation android.test.InstrumentationTestRunner on device emulator-5554"... Nothing happens after that.I've been told to exit out of the application under test in the emulator in order to run the test again. Unfortunately the emulator doesn't have the app pulled up (it's in the normal "locked" position and when unlocked brings up the home screen) and even if I do pull it up then exit, it doesn't seem to let me run my tests again.All the example videos and tutorials all stop at the first run of a test. I have yet to see anyone anywhere run a test a second time!

View 1 Replies View Related

Android :: Multiple Dependent Android Projects In Eclipse

Jun 14, 2010

I just started to play with android dev and java+eclipse is pretty new to me. I managed to create simple project and run it on my device. Now I want to create simple game (more of them actually) and I would love to use shared code base for all of them (game loop, initialization, etc..). Problem is that I have no idea how to correctly do this. I created android project called engine with all basic stuff that I need and made it work on device. Now I tried to create another project in same workspace called mygame. Main class (activity) of mygame is MyGameApp which inherits from EngineApp (main activity of my engine project) which inherits from Activity. I added engine project into required projects in mygame build path tab in properties. Problem is that when I try to run this project it crashes on ClassNotFoundException trying to find my MyGameApp class.

View 1 Replies View Related

Android :: Attempt To Debug Project Consistently Hangs At "Running Tests"

Sep 24, 2010

I have an Android project that I have been working on and debugging just fine for several months, but for some reason it is now consistently hanging at the "Runnning tests..." step. I have experienced intermittent hangs from the beginning, but a simple retry and/or restart of Eclipse or the emulator usually resolves it. But now I am just dead in the water.I can run my tests fine, and I can debug my actual program, but I can't debug my tests.I have tried creating a new emulator and that doesn't fix it. I also cleared all my breakpoints and that had no effect.As far as what has changed lately, the primary thing is that I upgraded to rev 7 of the SDK tools. Also, I recently did some debugging (of the program not the tests) on an actual device (not the emulator). Can't see how that would impact it but I thought I would mention it.Actually I had to set Debuggable to "true" in the app manifest to get device debugging to work. Although I have never had that set in my test project, I set it, and that also had no effect on the issue.I'm running out of ideas, and I would greatly appreciate some pointers.

View 1 Replies View Related

Android :: IOException When Running Android Projects In Eclipse

Jun 17, 2010

Every time I try to run an Android project from Eclipse with the Android plugin (Run -> Run), the emulator starts up just fine, but the upload fails, and the Console puts out this error message:

[2010-06-17 08:17:55 - HelloAndroid] Failed to upload HelloAndroid.apk on device 'emulator-5554'
[2010-06-17 08:17:55 - HelloAndroid] java.io.IOException: Unable to upload file: Local file doesn't exist.
[2010-06-17 08:17:55 - HelloAndroid] Launch canceled!

It seems as though the apk compilation is failing, but there are no other errors in the Console at all except for a lone warning about the project not specifying an API Level requirement:

[2010-06-17 08:17:55 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-06-17 08:17:55 - HelloAndroid] Device API version is 8 (Android 2.2)

View 3 Replies View Related

Android :: Running Multiple Activities

Jun 23, 2010

I have developed a simple android application, which when started opens a Timer. User is given two buttons, start/ pause. This is working fine.What i want to do is to add a way to support multiple timers when a user swipes his finger on the screen.When he swipes from left to right, a new timer should show up, but the previous timer should not stop. This is a way to add multiple timers.Also, when he swipes from right to left, i want a previous timer to show.This is what i have done so for. I have a timer activity. I have added a touch event on it. When, a person swipes his finger, i get the co-ordinates and decide whether its from left to right or right to left.This functionality is working fine, as i can see the appropriate log messages.The problem is when I'm trying to load Timer Activity.It just loads the previous Activity and doesn't really create a new one (I figured this from the timer).Is there any way to do it?

View 1 Replies View Related

Android :: Possible To Avoid Running Of Multiple Process

Mar 3, 2010

I facing problem with multiple process running for my application. Can any one help me to avoid creating multiple process or restricting process creation to one.

Some times I am seeing two process instances of my package in the process list. I want to avoid this.

View 2 Replies View Related

Android :: Running Multiple Activities In For Loop One After Other

Oct 1, 2010

I have multiple activities in my android app and one final activity "All" which should run all the activities of my app one after the other. When I kept all my activities in for loop and used startactivity(intent) for each activity in that for loop, at the end I could see not all my activities being ran although all activities are finished. Any clue how to implement this?

View 3 Replies View Related

Android :: Running Multiple AsyncTasks At The Same Time - Not Possible?

Nov 1, 2010

I'm trying to run two AsyncTasks at the same time. (Platform is Android 1.5, HTC Hero.) However, only the first gets executed.

Here's a simple snippet to describe my problem:

CODE:................

The output I expect is:

onCreate() is done.
bar bar bar
foo foo foo
bar bar bar
foo foo foo

And so on. However, what I get is:

onCreate() is done.
bar bar bar
bar bar bar
bar bar bar

The second AsyncTask never gets executed. If I change the order of the execute() statements, only the foo task will produce output.

Am I missing something obvious here and/or doing something stupid? Is it not possible to run two AsyncTasks at the same time?

I realized the phone in question runs Android 1.5, I updated the problem descr. accordingly. I don't have this problem with an HTC Hero running Android 2.1.

View 1 Replies View Related

Android :: Running Multiple Istrumentation Simultaneously

Jun 27, 2009

This is what I have,say:

CODE:..............

All of the above is in single APK.

Instrumentation Runer used is - android.test.InstrumenationTestRunner itself.

This is what I am trying:

- I launched Emulator having above apk

- I opened three terminals , two to run instrumentation and third one to log results i.e.

CODE:...........................

Terminal 2:

CODE:...............................

Terminal 3: This is what I saw in the middle of logcat dump:

CODE:..........

Queries: 1. Is not it possible to run instrumentation in above manner? 2. I tried another TestSuite2 in terminal 2 instead of TestSuite1 , this also gave same results.

My aim is to run 2 testsuites parallel, using same apk. Is it possible? Or I have to use two different apks?

View 3 Replies View Related

Android :: Phone Storage Running Out After Multiple Installs

Sep 4, 2010

When testing my app on a device I go through several "installs", although it's really the Eclipse plugin doing this for me.After a while (not very long) the device starts complaining about insufficient storage.It seems that progressive "re-installs" eats away the phone storage even though the app being installed (presumably) is either removed by Eclipse first or at least overwritten.Interestingly if I use a task killer to kill everything on the phone (which I only use for dev purposes btw),the available storage indicator recovers and I can keep working.As I said, it's more annoying than anything as the workaround.well works, but I'm wondering if there is some sort of cache chewing up storage?More importantly, I'm a little concerned that the same may happen with updates from the Market?That is, the update effectively replacing the current version of the app but leaving an allocation of storage behind in its wake.

View 5 Replies View Related

Android :: Multiple Application Icons Are Installed On Phone When Running App

Oct 15, 2010

I am developing an android app w/ Eclipse.Whenever I run the app on my phone or the emulator, four application icons are installed on the device.I am guessing it is related to my manifest file which has three activities (3 are for tabs).When I uninstall the app, all of the icons are removed from the phone.Upon a reinstall, all four show back up.

View 2 Replies View Related

HTC Droid Eris :: Playing Pandora Through Their Car With An Auxiliary Hookup

Jul 19, 2010

Recently got an auxiliary cable for my car to play Pandora through the stereo while on the road. I notice that when i start it up, Pandora immediately starts skipping songs till it runs out of song skips. Then it will start playing normally. Other times the service won't run at all while it's plugged in.

When i don't have the Eris hooked up to the car Pandora works flawlessly, has anyone else experienced this problem?

View 5 Replies View Related

Motorola Droid : Auxiliary Audio Sound Cable To Connect Radio In Car

Nov 20, 2009

Has any1 else had any problems using an auxiliary audio cable to connect their droid to their radio in their car? I have been trying it out the last few days and have noticed "crackling" in the left speakers. If i fiddle with the Aux cable that plugs into the phone it clears up. But as soon as I let go its back. Has any1 else had this problem? Is the only fix to return the phone? I have a 39/09 btw.

View 5 Replies View Related

Android :: Inter Connectivity / Running Multiple Applications On Android

Jul 12, 2010

Is it possible to run multiple apps at the same time on Android? I have an app that has two separate layers and which they are normally launched separately. They open sockets and talk to each other via those sockets. I am not sure if this would be possible under Android - may be generate two separate projects and their corresponding UIs and then launch them at the same time. If that is not possible I am assuming I will need to launch them from the same UI - their interprocess sockets should be able to connect to each other. Is this something that is worth pursuing?

View 3 Replies View Related

HTC EVO 4G : Multiple Programs Running In Background

Jun 4, 2010

It seems I have multiple programs that will start on their own and run in the background. The main ones are mp3 store, voicemail, sprint nav, sprint tv and qik. I haven't even ran those programs yet, but they're still starting up.

I went so far as to download ATK and kill them...only to see them running again 5 minutes later. I tried to put all the settings the same as what I had on my hero, but these running in the background are driving me nuts for some reason.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved