{"id":1913,"date":"2010-05-02T03:58:38","date_gmt":"2010-05-02T07:58:38","guid":{"rendered":"http:\/\/www.gubatron.com\/blog\/?p=1913"},"modified":"2010-05-02T03:58:38","modified_gmt":"2010-05-02T07:58:38","slug":"how-to-do-unit-testing-on-android-with-eclipse","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/how-to-do-unit-testing-on-android-with-eclipse\/","title":{"rendered":"[SCREENCAST] How to do Unit Testing on Android with Eclipse"},"content":{"rendered":"<p><a href=\"http:\/\/www.gubatron.com\/blog\/2010\/05\/02\/how-to-do-unit-testing-on-android-with-eclipse\/#more-1913\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/androinica.com\/wp-content\/uploads\/2008\/10\/android_logo.png?resize=150%2C150\" width=\"150\" height=\"150\" class=\"alignleft\"><\/a>I was going to make a tutorial, but then I figured that making a video would be a much better way to show this.<br \/>\nAs for the code that you could grab from a tutorial, there&#8217;s a link at the end of the post with all the code shown in the video demo.<\/p>\n<p>The video demo covers how to create and run Unit Test classes for regular Java classes on Android, and also how to create and run Unit Test classes that test classes that depend on Android &#8220;Context&#8221; or &#8220;Activity&#8221; objects.<\/p>\n<p>If your Android unit tests are not running because of frustrating error messages, the time spent watching this video will save you a lot of reading and headaches.<\/p>\n<p>Check the screencast <a href=\"http:\/\/www.gubatron.com\/blog\/2010\/05\/02\/how-to-do-unit-testing-on-android-with-eclipse\/#more-1913\">after the break<\/a><\/p>\n<p><!--more--><br \/>\n<object width=\"560\" height=\"367\"><param name=\"movie\" value=\"http:\/\/www.dailymotion.com\/swf\/video\/xd5ki4?width=560&#038;theme=none&#038;foreground=%23F7FFFD&#038;highlight=%23FFC300&#038;background=%23171D1B&#038;start=&#038;additionalInfos=0&#038;autoPlay=0&#038;hideInfos=0&#038;colors=background%3A171D1B%3Bforeground%3AF7FFFD%3Bspecial%3AFFC300%3B\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><param name=\"allowScriptAccess\" value=\"always\"><\/param><\/object><br \/><b><a href=\"http:\/\/www.dailymotion.com\/video\/xd5ki4_how-to-unit-test-on-android-screenc_tech\">How to Unit Test on Android [SCREENCAST]<\/a><\/b><br \/><i>Uploaded by <a href=\"http:\/\/www.dailymotion.com\/wedoit4you\">wedoit4you<\/a>. &#8211; <a href=\"http:\/\/www.dailymotion.com\/us\/channel\/tech\">Explore more science and tech videos.<\/a><\/i><\/p>\n<p><a href=\"http:\/\/www.gubatron.com\/blog\/wp-content\/uploads\/2010\/05\/UnitTestDemoProject.tar.gz\">Download the Eclipse Project sources<\/a><\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was going to make a tutorial, but then I figured that making a video would be a much better way to show this. As for the code that you could grab from a tutorial, there&#8217;s a link at the end of the post with all the code shown in the video demo. The video [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,15,30,71,74],"tags":[1434,1443,583,810,1037,1038],"class_list":["post-1913","post","type-post","status-publish","format-standard","hentry","category-android","category-code","category-geeklife","category-screencasts","category-software-development","tag-android","tag-google","tag-java","tag-programming","tag-unit-test","tag-unit-testing"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Unzf-uR","jetpack-related-posts":[{"id":806,"url":"https:\/\/www.gubatron.com\/blog\/blooploader-screencast-tutorial\/","url_meta":{"origin":1913,"position":0},"title":"Blooploader Screencast Tutorial","author":"gubatron","date":"May 8, 2008","format":false,"excerpt":"A 3 minute demo of how to upload files in MyBloop.com with the Blooploader beta.","rel":"","context":"In &quot;MyBloop.com&quot;","block_context":{"text":"MyBloop.com","link":"https:\/\/www.gubatron.com\/blog\/category\/mybloopcom\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":789,"url":"https:\/\/www.gubatron.com\/blog\/screencast-what-is-mybloop\/","url_meta":{"origin":1913,"position":1},"title":"[SCREENCAST] What is MyBloop?","author":"gubatron","date":"April 28, 2008","format":false,"excerpt":"","rel":"","context":"In &quot;MyBloop.com&quot;","block_context":{"text":"MyBloop.com","link":"https:\/\/www.gubatron.com\/blog\/category\/mybloopcom\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":753,"url":"https:\/\/www.gubatron.com\/blog\/screencast-how-to-create-a-mybloop-music-playlist\/","url_meta":{"origin":1913,"position":2},"title":"[SCREENCAST] How to create a MyBloop Music Playlist","author":"gubatron","date":"March 22, 2008","format":false,"excerpt":"Here's a simple tutorial on how to create a playlist and then how to put it on your favorite web page.","rel":"","context":"In &quot;M\u00c3\u00basica&quot;","block_context":{"text":"M\u00c3\u00basica","link":"https:\/\/www.gubatron.com\/blog\/category\/musica\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3020,"url":"https:\/\/www.gubatron.com\/blog\/how-to-avoid-android-compilationbuilding-issues-setting-up-the-eclipse-buildpath-correctly\/","url_meta":{"origin":1913,"position":3},"title":"How to avoid Android compilation\/building issues &#8211; Setting up the Eclipse Buildpath correctly","author":"gubatron","date":"May 21, 2013","format":false,"excerpt":"This post is the product of about 48 hours of not being able to work on what I was supposed to be working because I had to deal with build issues in Eclipse. Hopefully If you follow these steps you will be able to solve some of the issues you\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/www.gubatron.com\/blog\/category\/android\/"},"img":{"alt_text":"Screen Shot 2013-05-21 at 12.13.46 PM","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/05\/Screen-Shot-2013-05-21-at-12.13.46-PM.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/05\/Screen-Shot-2013-05-21-at-12.13.46-PM.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/05\/Screen-Shot-2013-05-21-at-12.13.46-PM.png?resize=525%2C300 1.5x"},"classes":[]},{"id":2957,"url":"https:\/\/www.gubatron.com\/blog\/my-first-raspberry-pi-project-diy-video-game-console\/","url_meta":{"origin":1913,"position":4},"title":"My First Raspberry PI Project: DIY ARM Video Game Console.","author":"gubatron","date":"April 4, 2013","format":false,"excerpt":"I got everything on amazon, didn't pay for shipping (Prime member): So far I bought: - Raspberry PI ($48) - Raspberry PI case ($14) - Power adapter ($2.25) - SNES-like Controller with USB jack ($10.75) - SanDisk SDHC 16GB class 6 (30mb\/s) ($15) I first intend to install Ubuntu ARM\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/www.gubatron.com\/blog\/category\/android\/"},"img":{"alt_text":"raspberry_pi_diy_game_console_nes_snes_sega_n64","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2013\/04\/raspberry_pi_diy_game_console_nes_snes_sega_n64.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2887,"url":"https:\/\/www.gubatron.com\/blog\/android-changing-textview-alpha-transparency-across-different-target-sdks\/","url_meta":{"origin":1913,"position":5},"title":"Android: Changing TextView alpha transparency across different target SDKs","author":"gubatron","date":"November 30, 2012","format":false,"excerpt":"Sometimes you may need to make a TextView (label) look a little transparent to make emphasis on other parts of your UI. The .setAlpha() function on TextView is not supported after later in the SDK. Here's a static workaround you can place on some sort of UIUtils class you may\u2026","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.gubatron.com\/blog\/tag\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/1913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=1913"}],"version-history":[{"count":0,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/1913\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=1913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=1913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=1913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}