Only run astrid connectedAndroidTest

pull/143/head
Alex Baker 10 years ago
parent d63549723c
commit 6e25f139f3

@ -11,4 +11,4 @@ before_install:
- adb shell input keyevent 82 &
script:
- ./gradlew connectedAndroidTest
- ./gradlew :astrid:connectedAndroidTest

@ -89,7 +89,4 @@ dependencies {
compile group: 'com.google.http-client', name: 'google-http-client-extensions-android3', version: '1.6.0-beta', transitive: false
compile group: 'com.google.oauth-client', name: 'google-oauth-client', version: '1.6.0-beta', transitive: false
compile group: 'com.google.oauth-client', name: 'google-oauth-client-extensions', version: '1.6.0-beta', transitive: false
androidTestCompile group: 'junit', name: 'junit', version: '4.10', transitive: false
androidTestCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.5', transitive: false
}

@ -9,8 +9,8 @@ import com.todoroo.astrid.data.RemoteModel;
import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
@SuppressLint("NewApi")
public class RemoteModelHelpers {
@ -18,7 +18,7 @@ public class RemoteModelHelpers {
Set<String> keys = contentValues.keySet();
Property[] result = new Property[keys.size()];
int index = 0;
for(String key : keys) {
for (String key : keys) {
result[index++] = new Property.StringProperty(table, key);
}
return result;
@ -30,19 +30,19 @@ public class RemoteModelHelpers {
}
private static void compareContentValues(ContentValues expected, ContentValues actual) {
if(expected == null && actual == null) {
if (expected == null && actual == null) {
return;
}
if(expected == null || actual == null) {
if (expected == null || actual == null) {
fail();
}
for(String key : expected.keySet()) {
for (String key : expected.keySet()) {
Object entry = expected.get(key);
if(entry instanceof Integer) {
if (entry instanceof Integer) {
assertEquals(entry, actual.getAsInteger(key));
} else if(entry instanceof String) {
} else if (entry instanceof String) {
assertEquals(entry, actual.getAsString(key));
} else if(entry instanceof Long) {
} else if (entry instanceof Long) {
assertEquals(entry, actual.getAsLong(key));
} else {
fail("Unhandled property type: " + entry.getClass());

Loading…
Cancel
Save