aboutsummaryrefslogtreecommitdiffstats
path: root/AndroidAsyncTest
diff options
context:
space:
mode:
Diffstat (limited to 'AndroidAsyncTest')
-rw-r--r--AndroidAsyncTest/.classpath1
-rw-r--r--AndroidAsyncTest/AndroidAsyncTest.iml26
-rw-r--r--AndroidAsyncTest/gen/com/koushikdutta/async/test/BuildConfig.java2
-rw-r--r--AndroidAsyncTest/gen/com/koushikdutta/async/test/Manifest.java7
-rw-r--r--AndroidAsyncTest/gen/com/koushikdutta/async/test/R.java18
-rw-r--r--AndroidAsyncTest/project.properties1
-rw-r--r--AndroidAsyncTest/src/com/koushikdutta/async/test/HttpClientTests.java8
-rw-r--r--AndroidAsyncTest/src/com/koushikdutta/async/test/MultipartTests.java1
-rw-r--r--AndroidAsyncTest/src/com/koushikdutta/async/test/SanityChecks.java15
9 files changed, 60 insertions, 19 deletions
diff --git a/AndroidAsyncTest/.classpath b/AndroidAsyncTest/.classpath
index 653dc7f..6982030 100644
--- a/AndroidAsyncTest/.classpath
+++ b/AndroidAsyncTest/.classpath
@@ -5,5 +5,6 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
diff --git a/AndroidAsyncTest/AndroidAsyncTest.iml b/AndroidAsyncTest/AndroidAsyncTest.iml
new file mode 100644
index 0000000..918e7d3
--- /dev/null
+++ b/AndroidAsyncTest/AndroidAsyncTest.iml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="android" name="Android">
+ <configuration>
+ <notImportedProperties>
+ <property>MANIFEST_FILE_PATH</property>
+ <property>RESOURCES_DIR_PATH</property>
+ <property>ASSETS_DIR_PATH</property>
+ <property>NATIVE_LIBS_DIR_PATH</property>
+ </notImportedProperties>
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ </content>
+ <orderEntry type="jdk" jdkName="Android 4.2.2" jdkType="Android SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="AndroidAsync" />
+ </component>
+</module>
+
diff --git a/AndroidAsyncTest/gen/com/koushikdutta/async/test/BuildConfig.java b/AndroidAsyncTest/gen/com/koushikdutta/async/test/BuildConfig.java
index b92f35f..11c34e7 100644
--- a/AndroidAsyncTest/gen/com/koushikdutta/async/test/BuildConfig.java
+++ b/AndroidAsyncTest/gen/com/koushikdutta/async/test/BuildConfig.java
@@ -1,3 +1,5 @@
+/*___Generated_by_IDEA___*/
+
/** Automatically generated file. DO NOT MODIFY */
package com.koushikdutta.async.test;
diff --git a/AndroidAsyncTest/gen/com/koushikdutta/async/test/Manifest.java b/AndroidAsyncTest/gen/com/koushikdutta/async/test/Manifest.java
new file mode 100644
index 0000000..b296c6f
--- /dev/null
+++ b/AndroidAsyncTest/gen/com/koushikdutta/async/test/Manifest.java
@@ -0,0 +1,7 @@
+/*___Generated_by_IDEA___*/
+
+package com.koushikdutta.async.test;
+
+/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
+public final class Manifest {
+} \ No newline at end of file
diff --git a/AndroidAsyncTest/gen/com/koushikdutta/async/test/R.java b/AndroidAsyncTest/gen/com/koushikdutta/async/test/R.java
index 3ed3fee..84720c2 100644
--- a/AndroidAsyncTest/gen/com/koushikdutta/async/test/R.java
+++ b/AndroidAsyncTest/gen/com/koushikdutta/async/test/R.java
@@ -1,19 +1,7 @@
-/* AUTO-GENERATED FILE. DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found. It
- * should not be modified by hand.
- */
+/*___Generated_by_IDEA___*/
package com.koushikdutta.async.test;
+/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
- public static final class attr {
- }
- public static final class drawable {
- public static final int ic_launcher=0x7f020000;
- }
- public static final class string {
- public static final int app_name=0x7f030000;
- }
-}
+} \ No newline at end of file
diff --git a/AndroidAsyncTest/project.properties b/AndroidAsyncTest/project.properties
index a3ee5ab..32fa4ac 100644
--- a/AndroidAsyncTest/project.properties
+++ b/AndroidAsyncTest/project.properties
@@ -12,3 +12,4 @@
# Project target.
target=android-17
+android.library.reference.1=../AndroidAsync
diff --git a/AndroidAsyncTest/src/com/koushikdutta/async/test/HttpClientTests.java b/AndroidAsyncTest/src/com/koushikdutta/async/test/HttpClientTests.java
index 4408080..309d072 100644
--- a/AndroidAsyncTest/src/com/koushikdutta/async/test/HttpClientTests.java
+++ b/AndroidAsyncTest/src/com/koushikdutta/async/test/HttpClientTests.java
@@ -34,7 +34,7 @@ public class HttpClientTests extends TestCase {
client = new AsyncHttpClient(server);
}
- private static final long TIMEOUT = 10000L;
+ private static final long TIMEOUT = 100000L;
public void testHomepage() throws Exception {
Future<String> ret = client.get("http://google.com", (StringCallback)null);
assertNotNull(ret.get(TIMEOUT, TimeUnit.MILLISECONDS));
@@ -69,8 +69,8 @@ public class HttpClientTests extends TestCase {
}
});
- assertTrue(semaphore.tryAcquire(TIMEOUT, TimeUnit.MILLISECONDS));
- assertTrue(md5.digest().equals(dataNameAndHash));
+ assertTrue("timeout", semaphore.tryAcquire(TIMEOUT, TimeUnit.MILLISECONDS));
+ assertTrue("md5", md5.digest().equals(dataNameAndHash));
}
public void testGithubRandomDataWithFuture() throws Exception {
@@ -107,7 +107,7 @@ public class HttpClientTests extends TestCase {
});
try {
- future.get(3000, TimeUnit.MILLISECONDS);
+ future.get(TIMEOUT, TimeUnit.MILLISECONDS);
// this should never reach here as it was cancelled
fail();
}
diff --git a/AndroidAsyncTest/src/com/koushikdutta/async/test/MultipartTests.java b/AndroidAsyncTest/src/com/koushikdutta/async/test/MultipartTests.java
index 3737026..d2a7725 100644
--- a/AndroidAsyncTest/src/com/koushikdutta/async/test/MultipartTests.java
+++ b/AndroidAsyncTest/src/com/koushikdutta/async/test/MultipartTests.java
@@ -87,6 +87,7 @@ public class MultipartTests extends TestCase {
public void testUpload() throws Exception {
File dummy = new File(Environment.getExternalStorageDirectory(), "AndroidAsync/dummy.txt");
final String FIELD_VAL = "bar";
+ dummy.getParentFile().mkdirs();
FileOutputStream fout = new FileOutputStream(dummy);
byte[] zeroes = new byte[100000];
for (int i = 0; i < 10; i++) {
diff --git a/AndroidAsyncTest/src/com/koushikdutta/async/test/SanityChecks.java b/AndroidAsyncTest/src/com/koushikdutta/async/test/SanityChecks.java
new file mode 100644
index 0000000..69cc566
--- /dev/null
+++ b/AndroidAsyncTest/src/com/koushikdutta/async/test/SanityChecks.java
@@ -0,0 +1,15 @@
+package com.koushikdutta.async.test;
+
+import junit.framework.TestCase;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * Created by koush on 5/15/13.
+ */
+public class SanityChecks extends TestCase {
+ public void testByteOrder() {
+ assertTrue(ByteBuffer.allocate(0).order().equals(ByteOrder.BIG_ENDIAN));
+ }
+}