diff options
Diffstat (limited to 'AndroidAsyncTest/src')
3 files changed, 20 insertions, 4 deletions
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)); + } +} |