title: Running Android ActivityUnitTestCase results in "RuntimeException: could not find test class"
body: <p>Trying to generate a simple ActivityUnitTestCase to test various Fragments in my Android code.</p>
  
  <pre><code>public class MenuFragmentTest extends ActivityUnitTestCase&lt;FragmentAdapter&gt; {
      static {
          FragmentAdapter.setFragmentUnderTest(new MenuFragment());
      }
  
      public MenuFragmentTest() {
          super(FragmentAdapter.class);
      }
  
      public void testMenuOptions() {
          System.out.println(getActivity().findViewById(1));
      }
  }
  </code></pre>
  
  <p>The generalized FragmentAdapter that I'm trying to use to test Fragments in the app:</p>
  
  <pre><code>public class FragmentAdapter extends FragmentActivity {
      static Fragment fragmentUnderTest;
  
      public static void setFragmentUnderTest(Fragment fragmentUnderTest) {
          FragmentAdapter.fragmentUnderTest = fragmentUnderTest;
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          LinearLayout ll = new LinearLayout(this);
          ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
          setContentView(ll);
  
          FragmentManager fragmentManager = getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
          fragmentTransaction.add(fragmentUnderTest, null);
  
          fragmentTransaction.commit();
      }
  }
  </code></pre>
  
  <p>After the main app installs successfully, the Android JUnit Test Runner fails with</p>
  
  <pre><code>java.lang.RuntimeException: Could not find test class.  Class: com.XXX.core.MenuFragment
  </code></pre>
  
  <p>Why can the Test Runner not find the test class I am running?</p>