diff options
author | Koushik Dutta <koushd@gmail.com> | 2013-05-17 19:42:36 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2013-05-17 19:42:36 -0700 |
commit | 391c195fa61c47f3c64b5e5d9c80ec2e32b20683 (patch) | |
tree | 1866f29f9d014572f71cd6bdf1d5040bd13a8e06 /AndroidAsync/src/com/koushikdutta/async/AsyncServer.java | |
parent | 1f0cfefed66d91acca8eb0625f9af8cd93841c31 (diff) | |
download | AndroidAsync-391c195fa61c47f3c64b5e5d9c80ec2e32b20683.tar.gz AndroidAsync-391c195fa61c47f3c64b5e5d9c80ec2e32b20683.tar.bz2 AndroidAsync-391c195fa61c47f3c64b5e5d9c80ec2e32b20683.zip |
more replacements of junit Assert with assert keyword.
Diffstat (limited to 'AndroidAsync/src/com/koushikdutta/async/AsyncServer.java')
-rw-r--r-- | AndroidAsync/src/com/koushikdutta/async/AsyncServer.java | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/AndroidAsync/src/com/koushikdutta/async/AsyncServer.java b/AndroidAsync/src/com/koushikdutta/async/AsyncServer.java index 3d23770..8130e90 100644 --- a/AndroidAsync/src/com/koushikdutta/async/AsyncServer.java +++ b/AndroidAsync/src/com/koushikdutta/async/AsyncServer.java @@ -1,16 +1,20 @@ package com.koushikdutta.async; +import android.os.Build; +import android.os.Handler; +import android.util.Log; +import com.koushikdutta.async.callback.CompletedCallback; +import com.koushikdutta.async.callback.ConnectCallback; +import com.koushikdutta.async.callback.ListenCallback; +import com.koushikdutta.async.future.Cancellable; +import com.koushikdutta.async.future.SimpleCancelable; +import com.koushikdutta.async.future.SimpleFuture; + import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; -import java.nio.channels.ClosedChannelException; -import java.nio.channels.ClosedSelectorException; -import java.nio.channels.DatagramChannel; -import java.nio.channels.SelectionKey; -import java.nio.channels.Selector; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SocketChannel; +import java.nio.channels.*; import java.nio.channels.spi.SelectorProvider; import java.util.Hashtable; import java.util.LinkedList; @@ -19,18 +23,6 @@ import java.util.WeakHashMap; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; -import junit.framework.Assert; -import android.os.Build; -import android.os.Handler; -import android.util.Log; - -import com.koushikdutta.async.callback.CompletedCallback; -import com.koushikdutta.async.callback.ConnectCallback; -import com.koushikdutta.async.callback.ListenCallback; -import com.koushikdutta.async.future.Cancellable; -import com.koushikdutta.async.future.SimpleCancelable; -import com.koushikdutta.async.future.SimpleFuture; - public class AsyncServer { public static final String LOGTAG = "NIO"; @@ -572,7 +564,7 @@ public class AsyncServer { synchronized (this) { if (mSelector != null) { Log.i(LOGTAG, "Reentrant call"); - Assert.assertEquals(Thread.currentThread(), mAffinity); + assert Thread.currentThread() == mAffinity; // this is reentrant reentrant = true; selector = mSelector; @@ -811,7 +803,7 @@ public class AsyncServer { } else { Log.i(LOGTAG, "wtf"); - Assert.fail(); + assert false; } } catch (Exception ex) { |