title: Unit testing Android Apps on Eclipse + jUnit - Test run failed: Test run incomplete. Expected 1 tests, received 0
body: <p>I'm trying to get some unit tests up for my Android apps. I was following the <a href="http://developer.android.com/resources/tutorials/testing/helloandroid_test.html" rel="noreferrer">Hello, Testing</a> tutorial from the Android dev center, but it's giving me a message that reads:</p>
  
  <blockquote>
    <p>Test run failed: Test run incomplete. Expected 1 tests, received 0</p>
  </blockquote>
  
  <p>Here's the code I have:</p>
  
  <pre><code>public class LoginTest extends ActivityInstrumentationTestCase2&lt;Login&gt; {
  
  Activity mActivity;
  EditText mLoginTxt;
  EditText mPwdTxt;
  Button mLoginBtn;
  Button mClearBtn;
  
  public LoginTest(String pkg, Class&lt;Login&gt; activityClass) {
      super("pkg_name", Login.class);
  }
  
  @Override
  public void setUp() throws Exception {
      super.setUp();
  }
  
  public void testPreconditions() {
  
  }
  
  public void testClear() {
      assertTrue(true);
  }
  </code></pre>
  
  <p>Here's the console output:</p>
  
  <pre><code>[2011-08-23 12:21:12 - &lt;AppNameTest&gt;] ------------------------------
  [2011-08-23 12:21:12 - &lt;AppNameTest&gt;] Android Launch!
  [2011-08-23 12:21:12 - &lt;AppNameTest&gt;] adb is running normally.
  [2011-08-23 12:21:12 - &lt;AppNameTest&gt;] Performing android.test.InstrumentationTestRunner JUnit launch
  [2011-08-23 12:21:12 - &lt;AppNameTest&gt;] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'AndroidHDPI'
  [2011-08-23 12:21:14 - &lt;AppNameTest&gt;] Application already deployed. No need to reinstall.
  [2011-08-23 12:21:14 - &lt;AppNameTest&gt;] Project dependency found, installing: &lt;AppName&gt;
  [2011-08-23 12:21:16 - &lt;AppNameTest&gt;] Application already deployed. No need to reinstall.
  [2011-08-23 12:21:16 - &lt;AppNameTest&gt;] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554
  [2011-08-23 12:21:18 - &lt;AppNameTest&gt;] Collecting test information
  [2011-08-23 12:21:20 - &lt;AppNameTest&gt;] Test run failed: Test run incomplete. Expected 1 tests, received 0
  </code></pre>
  
  <p>And here's the LogCat output:</p>
  
  <pre><code>08-23 12:28:41.905: DEBUG/AndroidRuntime(1092): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  08-23 12:28:41.905: DEBUG/AndroidRuntime(1092): CheckJNI is ON
  08-23 12:28:42.155: DEBUG/AndroidRuntime(1092): --- registering native functions ---
  08-23 12:28:42.995: DEBUG/AndroidRuntime(1092): Shutting down VM
  08-23 12:28:43.005: DEBUG/dalvikvm(1092): Debugger has detached; object registry had 1 entries
  08-23 12:28:43.025: INFO/AndroidRuntime(1092): NOTE: attach of thread 'Binder Thread #3' failed
  08-23 12:28:43.625: DEBUG/AndroidRuntime(1100): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  08-23 12:28:43.625: DEBUG/AndroidRuntime(1100): CheckJNI is ON
  08-23 12:28:43.876: DEBUG/AndroidRuntime(1100): --- registering native functions ---
  08-23 12:28:44.735: DEBUG/AndroidRuntime(1100): Shutting down VM
  08-23 12:28:44.745: DEBUG/dalvikvm(1100): Debugger has detached; object registry had 1 entries
  08-23 12:28:44.765: INFO/AndroidRuntime(1100): NOTE: attach of thread 'Binder Thread #3' failed
  08-23 12:28:45.385: DEBUG/AndroidRuntime(1108): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  08-23 12:28:45.385: DEBUG/AndroidRuntime(1108): CheckJNI is ON
  08-23 12:28:45.645: DEBUG/AndroidRuntime(1108): --- registering native functions ---
  08-23 12:28:46.555: INFO/ActivityManager(59): Force stopping package com.PatientPoint.MCC uid=10038
  08-23 12:28:46.625: INFO/ActivityManager(59): Start proc &lt;pkg_name&gt; for added application &lt;pkg_name&gt;: pid=1114 uid=10038 gids={3003}
  08-23 12:28:47.196: INFO/TestRunner(1114): started: warning(junit.framework.TestSuite$1)
  08-23 12:28:47.236: INFO/ActivityManager(59): Force stopping package &lt;pkg_name&gt; uid=10038
  08-23 12:28:47.246: INFO/Process(59): Sending signal. PID: 1114 SIG: 9
  08-23 12:28:47.355: DEBUG/AndroidRuntime(1108): Shutting down VM
  08-23 12:28:47.375: DEBUG/jdwp(1108): Got wake-up signal, bailing out of select
  08-23 12:28:47.375: DEBUG/dalvikvm(1108): Debugger has detached; object registry had 1 entries
  08-23 12:28:47.415: INFO/AndroidRuntime(1108): NOTE: attach of thread 'Binder Thread #3' failed
  </code></pre>