loopj/android-async-http — pull request #236 by wuyexiong (2013-05-21 10:28:05+00:00)
Title: In order to use the async in Android test cases

In order to use the async in Android test cases

```
public class SongAPITest extends InstrumentationTestCase {
private String TAG = "OMusicSongAPITest";

public void getRecommendSongs() throws Throwable
{
final CountDownLatch signal = new CountDownLatch(1);
runTestOnUiThread(new Runnable() {

@Override
public void run() {
OMusicApiService.getInstance().getRecommendSongs(1, "", new RecommendSongsHandler()
{
@Override
public void onSuccess(RecommendSongs recommendSongs)
{
Log.v(TAG, "success");
ArrayList songs = recommendSongs.songs;
if(!songs.isEmpty())
{
for(Song song : songs)
{
Log.v(TAG, "songname : " + song.toString());
}
}
}

@Override
public void onFailure(Throwable error,
String content) {
Log.e(TAG, "error:" + error.toString());
}

@Override
public void onFinish() {
Log.v(TAG, "onFinish");
signal.countDown();
}

@Override
public void onStart() {
Log.v(TAG, "onStart");
}

});
try {
signal.await(250, TimeUnit.SECONDS);
} catch (InterruptedException e) {
}
Log.v(TAG, "getRecommendSongs Over");
}
});
}
}

```