diff --git a/.gitignore b/.gitignore index 9068cd0..4ce9130 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ proguard/ # Log Files *.log + +#Intellij Files +*.iml +.idea \ No newline at end of file diff --git a/TestRobolectric.iml b/TestRobolectric.iml deleted file mode 100644 index 0bb6048..0000000 --- a/TestRobolectric.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index 1711cd8..0000000 --- a/app/app.iml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/build.gradle b/app/build.gradle index 16faf81..8d6b2db 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.application' -apply plugin: 'robolectric' android { packagingOptions { @@ -16,61 +15,22 @@ android { targetSdkVersion 18 versionCode 2 versionName "1.0.0-SNAPSHOT" - testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } - - buildTypes { - release { - runProguard false - } - } - - sourceSets { - androidTest { - setRoot('src/androidTest') - } - } -} - -robolectric { - include '**/*Test.class' - exclude '**/espresso/**/*.class' } dependencies { - repositories { - mavenCentral() - } compile 'com.sothree.slidinguppanel:library:2.0.1' - androidTestCompile('junit:junit:4.11') { - exclude module: 'hamcrest-core' - } // Espresso - androidTestCompile files('libs/espresso-1.1.jar') - androidTestCompile files('libs/testrunner-1.1.jar') - androidTestCompile files('libs/testrunner-runtime-1.1.jar') - androidTestCompile 'com.google.guava:guava:14.0.1' - androidTestCompile 'com.squareup.dagger:dagger:1.1.0' - androidTestCompile 'org.hamcrest:hamcrest-integration:1.1' - androidTestCompile 'org.hamcrest:hamcrest-core:1.1' - androidTestCompile 'org.hamcrest:hamcrest-library:1.1' - androidTestCompile('org.robolectric:robolectric:2.3') { - exclude module: 'classworlds' - exclude module: 'commons-logging' - exclude module: 'httpclient' - exclude module: 'maven-artifact' - exclude module: 'maven-artifact-manager' - exclude module: 'maven-error-diagnostics' - exclude module: 'maven-model' - exclude module: 'maven-project' - exclude module: 'maven-settings' - exclude module: 'plexus-container-default' - exclude module: 'plexus-interpolation' - exclude module: 'plexus-utils' - exclude module: 'wagon-file' - exclude module: 'wagon-http-lightweight' - exclude module: 'wagon-provider-api' - } - androidTestCompile 'com.squareup:fest-android:1.0.+' + androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' + androidTestCompile 'com.android.support.test:runner:0.3' + androidTestCompile 'com.android.support.test:rules:0.3' + + // Robolectric + testCompile 'junit:junit:4.12' + testCompile 'org.hamcrest:hamcrest-core:1.1' + testCompile 'org.hamcrest:hamcrest-library:1.1' + testCompile 'org.hamcrest:hamcrest-integration:1.1' + testCompile 'org.robolectric:robolectric:3.0' } \ No newline at end of file diff --git a/app/src/androidTest/java/com/marcthomas/testrobolectric/ApplicationTest.java b/app/src/Test/java/com/marcthomas/testrobolectric/ApplicationTest.java similarity index 65% rename from app/src/androidTest/java/com/marcthomas/testrobolectric/ApplicationTest.java rename to app/src/Test/java/com/marcthomas/testrobolectric/ApplicationTest.java index 81d776d..23cedf4 100644 --- a/app/src/androidTest/java/com/marcthomas/testrobolectric/ApplicationTest.java +++ b/app/src/Test/java/com/marcthomas/testrobolectric/ApplicationTest.java @@ -1,7 +1,5 @@ package com.marcthomas.testrobolectric; -import android.app.Activity; - import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; @@ -10,10 +8,12 @@ import static org.junit.Assert.assertTrue; +@RunWith(RobolectricTestRunner.class) +@Config(manifest = "app/src/main/AndroidManifest.xml", sdk = 18) public class ApplicationTest { @Test public void testSomething() throws Exception { - assertTrue(true); + assertTrue(Robolectric.buildActivity(MyActivity.class).create().get() != null); } } diff --git a/app/src/main/res/drawable-hdpi/above_shadow.xml b/app/src/main/res/drawable-hdpi/above_shadow.xml new file mode 100644 index 0000000..dc2064b --- /dev/null +++ b/app/src/main/res/drawable-hdpi/above_shadow.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/below_shadow.xml b/app/src/main/res/drawable-hdpi/below_shadow.xml new file mode 100644 index 0000000..3fe8152 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/below_shadow.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index edee4ba..c4cd5fe 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.12.2' - classpath 'org.robolectric:robolectric-gradle-plugin:0.11.+' + classpath 'com.android.tools.build:gradle:1.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1e61d1f..d2146bb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-2.4-bin.zip