[android-developers] Re: POJO junit test in an Android project
Thanks for the reply. Test cases derived from Android junit.framework.TestCase still need the emulator to run. But I should have known better. Dalvik is not a JVM so of course it would be impossible to test Android code with tools written for JVM because Java class engineering would not apply to Dalvik. doug -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: POJO junit test in an Android project
I've set up Android test projects for my POJOs (or any code that doesn't depend on Android) and run them within Eclipse with no trouble (if that's what you're asking). You have to be tricky about the run configuration you use the launch the tests, though. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: POJO junit test in an Android project
Oh well, It doesn't seem that the Eclipse plug-in would even run a test case subclassed directly from junit.framework.TestCase. How do folks test POJOs in Android then? Thanks, doug -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: POJO junit test in an Android project
On Aug 10, 3:39 am, doug wrote: > Oh well, It doesn't seem that the Eclipse plug-in would even run a > test case subclassed directly from junit.framework.TestCase. How do > folks test POJOs in Android then? Which junit.framework.TestCase you are using? One coming from android library will be just a stub I use jMockit to mock everything android in my testcases, and junit coming from somewhere else -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: POJO junit test in an Android project
The JUnit TestCase in Android should work. By default, the Eclipse plug-in will not build tests/ or its subdirectories into your application's .apk. I recommend you have one project for your main application, and another *project* for your test package. Notice that two different projects in Eclipse can point to the same directory structure. The project for your main application will point to /src, / res, etc. The project for your test package will point to /tests/ src, /tests/res, etc. The same value of is used for both projects. You can do this with the Android New Project wizard or Android New Test Project wizard (in SDK 2.2 at least). When you create the test project's location, uncheck default location and then enter / tests What problem are you running into when you try to run a test package containing subclasses of junit.framework.TestCase? You need to run it with InstrumentationTestRunner. See the Android 2.2 documentation "Testing and Instrumentation" and also "Testing in Eclipse, with ADT". Or, you can use AndroidTestCase, which extends junit.framework.TestCase. On Aug 10, 4:33 am, ko5tik wrote: > On Aug 10, 3:39 am, doug wrote: > > > Oh well, It doesn't seem that the Eclipse plug-in would even run a > > test case subclassed directly from junit.framework.TestCase. How do > > folks test POJOs in Android then? > > Which junit.framework.TestCase you are using? One coming from > android library > will be just a stub > > I use jMockit to mock everything android in my testcases, and junit > coming from somewhere else -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en