Skip to content

Commit a9c42ba

Browse files
committed
Updated sample to runner 0.2 and espresso 2.2, Hamcrest 1.3
- Updated all build.gradle files - Removed guava where possible - Replaced VisibleForTesting annotations to support-annotations - Hamcrest 1.3 update for onData() sample Change-Id: I5590c1ad57ea70690430090a1ad1fc8de2479583
1 parent 2def7bc commit a9c42ba

File tree

25 files changed

+44
-55
lines changed

25 files changed

+44
-55
lines changed

build.gradle

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
@@ -17,11 +17,6 @@ allprojects {
1717
jcenter()
1818
}
1919

20-
// Temporary workaround for bug: https://code.google.com/p/android-test-kit/issues/detail?id=136
21-
configurations.all {
22-
resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
23-
}
24-
2520
apply plugin: 'findbugs'
2621

2722
task findbugs(type: FindBugs) {
89.7 KB
Binary file not shown.
266 KB
Loading

espresso/BasicSample/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ android {
2424

2525
dependencies {
2626
// App dependencies
27-
compile 'com.android.support:support-annotations:22.1.0'
27+
compile 'com.android.support:support-annotations:22.2.0'
2828
compile 'com.google.guava:guava:18.0'
2929
// Testing-only dependencies
30-
androidTestCompile 'com.android.support.test:runner:0.2'
31-
androidTestCompile 'com.android.support.test:rules:0.2'
32-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
30+
androidTestCompile 'com.android.support.test:runner:0.3'
31+
androidTestCompile 'com.android.support.test:rules:0.3'
32+
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
3333
}

espresso/BasicSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

espresso/CustomMatcherSample/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ android {
3030

3131
dependencies {
3232
// App dependencies
33-
compile 'com.android.support:support-annotations:22.1.0'
33+
compile 'com.android.support:support-annotations:22.2.0'
3434
compile 'com.google.guava:guava:18.0'
3535
// Testing-only dependencies
36-
androidTestCompile 'com.android.support.test:runner:0.2'
37-
androidTestCompile 'com.android.support.test:rules:0.2'
38-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
36+
androidTestCompile 'com.android.support.test:runner:0.3'
37+
androidTestCompile 'com.android.support.test:rules:0.3'
38+
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
3939
}

espresso/CustomMatcherSample/app/src/main/java/com/example/android/testing/espresso/CustomMatcherSample/MainActivity.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818

1919
import android.app.Activity;
2020
import android.os.Bundle;
21+
import android.support.annotation.VisibleForTesting;
2122
import android.view.View;
2223
import android.widget.EditText;
2324

24-
import com.google.common.annotations.VisibleForTesting;
25-
2625
import java.util.Arrays;
2726
import java.util.List;
2827

espresso/CustomMatcherSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

espresso/DataAdapterSample/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ android {
2121

2222
dependencies {
2323
// App dependencies
24-
compile 'com.android.support:support-annotations:22.1.0'
24+
compile 'com.android.support:support-annotations:22.2.0'
2525
compile 'com.google.guava:guava:18.0'
2626
// Testing-only dependencies
27-
androidTestCompile 'com.android.support.test:runner:0.2'
28-
androidTestCompile 'com.android.support.test:rules:0.2'
29-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
27+
androidTestCompile 'com.android.support.test:runner:0.3'
28+
androidTestCompile 'com.android.support.test:rules:0.3'
29+
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
3030
}

espresso/DataAdapterSample/app/src/androidTest/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivityTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ public void toggle_ClickDoesntPropagate() {
152152
* @return a {@link DataInteraction} referencing the row
153153
*/
154154
private static DataInteraction onRow(String str) {
155-
return onData(allOf(
156-
is(instanceOf(Map.class)), hasEntry(equalTo(LongListActivity.ROW_TEXT), is(str))));
155+
return onData(hasEntry(equalTo(LongListActivity.ROW_TEXT), is(str)));
157156
}
158157
}

espresso/DataAdapterSample/app/src/main/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package com.example.android.testing.espresso.DataAdapterSample;
1818

19-
import com.google.common.annotations.VisibleForTesting;
2019
import com.google.common.collect.Maps;
2120

2221
import android.app.Activity;
2322
import android.os.Bundle;
23+
import android.support.annotation.VisibleForTesting;
2424
import android.view.LayoutInflater;
2525
import android.view.View;
2626
import android.view.ViewGroup;

espresso/DataAdapterSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

espresso/IntentsBasicSample/app/build.gradle

+5-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ android {
2424

2525
dependencies {
2626
// App dependencies
27-
compile 'com.google.guava:guava:18.0'
28-
27+
compile 'com.android.support:support-annotations:22.2.0'
2928
// Testing-only dependencies
30-
androidTestCompile 'com.android.support.test:runner:0.2'
31-
androidTestCompile 'com.android.support.test:rules:0.2'
32-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
33-
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.1'
29+
androidTestCompile 'com.android.support.test:runner:0.3'
30+
androidTestCompile 'com.android.support.test:rules:0.3'
31+
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
32+
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2'
3433
}

espresso/IntentsBasicSample/app/src/main/java/com/example/android/testing/espresso/BasicSample/ContactsActivity.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616

1717
package com.example.android.testing.espresso.BasicSample;
1818

19-
import com.google.common.annotations.VisibleForTesting;
20-
2119
import android.app.Activity;
2220
import android.content.Intent;
2321
import android.os.Bundle;
22+
import android.support.annotation.VisibleForTesting;
2423

2524
/**
2625
* This a placeholder Activity for a contacts screen. This activity is never opened and does not

espresso/IntentsBasicSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

espresso/MultiWindowSample/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ android {
3131

3232
dependencies {
3333
// App dependencies
34-
compile 'com.android.support:support-annotations:22.1.0'
34+
compile 'com.android.support:support-annotations:22.2.0'
3535
compile 'com.google.guava:guava:18.0'
3636
// Testing-only dependencies
37-
androidTestCompile 'com.android.support.test:runner:0.2'
38-
androidTestCompile 'com.android.support.test:rules:0.2'
39-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
37+
androidTestCompile 'com.android.support.test:runner:0.3'
38+
androidTestCompile 'com.android.support.test:rules:0.3'
39+
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
4040
}

espresso/MultiWindowSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

testrunner/AndroidJunitRunnerSample/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ android {
2727

2828
dependencies {
2929
// App's dependencies, including test
30-
compile 'com.android.support:support-annotations:22.1.0'
30+
compile 'com.android.support:support-annotations:22.2.0'
3131
compile 'com.google.guava:guava:18.0'
3232
// Testing-only dependencies
33-
androidTestCompile 'com.android.support.test:runner:0.2'
34-
androidTestCompile 'com.android.support.test:rules:0.2'
35-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
33+
androidTestCompile 'com.android.support.test:runner:0.3'
34+
androidTestCompile 'com.android.support.test:rules:0.3'
35+
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
3636
}

testrunner/AndroidJunitRunnerSample/app/src/main/java/com/example/android/testing/androidjunitrunnersample/CalculatorActivity.java

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import android.widget.EditText;
2626
import android.widget.TextView;
2727

28-
import java.util.Calendar;
29-
3028
/**
3129
* {@link android.app.Activity} which contains a simple calculator. Numbers can be entered in the
3230
* two {@link EditText} fields and result can be obtained by pressing one of the

testrunner/AndroidJunitRunnerSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

uiautomator/BasicSample/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ android {
2828
dependencies {
2929
compile 'com.google.guava:guava:18.0'
3030
// Testing-only dependencies
31-
androidTestCompile 'com.android.support.test:runner:0.2'
31+
androidTestCompile 'com.android.support.test:runner:0.3'
3232
// UiAutomator Testing
33-
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.0'
34-
androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
33+
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
34+
androidTestCompile 'org.hamcrest:hamcrest-integration:1.3'
3535
}

uiautomator/BasicSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99
}
1010
}
1111

unittesting/BasicSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ buildscript {
2020
jcenter()
2121
}
2222
dependencies {
23-
classpath 'com.android.tools.build:gradle:1.1.3'
23+
classpath 'com.android.tools.build:gradle:1.2.3'
2424

2525
// NOTE: Do not place your application dependencies here; they belong
2626
// in the individual module build.gradle files

unittesting/BasicUnitAndroidTest/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ android {
1818
}
1919

2020
dependencies {
21-
androidTestCompile 'com.android.support.test:runner:0.2'
22-
androidTestCompile 'org.hamcrest:hamcrest-library:1.1'
21+
androidTestCompile 'com.android.support.test:runner:0.3'
22+
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
2323
}

unittesting/BasicUnitAndroidTest/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.3'
8+
classpath 'com.android.tools.build:gradle:1.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

0 commit comments

Comments
 (0)