title: TestCase class not found by Android Studio
body: <p>I have written a simple test case class and placed it in the default test directory for Android Studio: "src/androidTest". I've created an Android Tests build configuration that looks for all Tests in the module. When I run the build configuration, my test does not execute and I get the following message in logcat: <code>W/TestGrouping﹕ Invalid Package: '' could not be found or has no tests</code>. If I specify the test package or even the specific test class, I get similar class not found messages.</p>
  
  <p>My test class is as follows:</p>
  
  <pre><code>public class FirstTest extends InstrumentationTestCase {
  
  public void testSample() {
          final int expected = 1;
          final int reality = 5;
          assertEquals(expected, reality);
      }
  }
  </code></pre>
  
  <p>My build.gradle file looks like this:</p>
  
  <pre><code>apply plugin: 'android'
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.0.1"
  
      defaultConfig {
          minSdkVersion 8
          targetSdkVersion 19
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
  }
  
  dependencies {
      compile 'com.android.support:gridlayout-v7:19.0.1'
      compile 'com.android.support:support-v4:19.0.1'
      compile 'com.android.support:appcompat-v7:19.0.1'
      compile fileTree(dir: 'libs', include: ['*.jar'])
  }
  </code></pre>
  
  <p>I'm running version 0.9 of the android gradle plugin. My top level build.gradle (a peer to the app directory) looks like this.</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.9.+'
      }
  }
  
  allprojects {
      repositories {
          mavenCentral()
      }
  }
  </code></pre>
  
  <p>My project directory structure is as follows:</p>
  
  <p><code>app
      src
          androidTest
              java
          main
              java
              res</code></p>