nio.channels: Add *Exception unit tests

java.nio.channels.AcceptPendingException
java.nio.channels.IllegalChannelGroupException
java.nio.channels.InterruptedByTimeoutException
java.nio.channels.ReadPendingException
java.nio.channels.ShutdownChannelGroupException
java.nio.channels.WritePendingException

Bug: 27214236
(cherry-picked from commit 3c914f8329187dad16d5668e04bca2bf9585c1ac)
Change-Id: I8e5a82b5ab6df2efac716c337c004052f4fb60b5
diff --git a/luni/src/test/java/libcore/java/nio/channels/AcceptPendingExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/AcceptPendingExceptionTest.java
new file mode 100644
index 0000000..12567c4
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/AcceptPendingExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.AcceptPendingException;
+
+public class AcceptPendingExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.AcceptPendingException#AcceptPendingException()
+     */
+    public void test_empty() {
+        AcceptPendingException e = new AcceptPendingException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/IllegalChannelGroupExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/IllegalChannelGroupExceptionTest.java
new file mode 100644
index 0000000..3e85927
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/IllegalChannelGroupExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.IllegalChannelGroupException;
+
+public class IllegalChannelGroupExceptionTest extends TestCase{
+
+    /**
+     * java.nio.channels.IllegalChannelGroupException#IllegalChannelGroupException()
+     */
+    public void test_empty() {
+        IllegalChannelGroupException e = new IllegalChannelGroupException();
+        assertTrue(e instanceof IllegalArgumentException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/InterruptedByTimeoutExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/InterruptedByTimeoutExceptionTest.java
new file mode 100644
index 0000000..38b1c45
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/InterruptedByTimeoutExceptionTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.io.IOException;
+import java.nio.channels.InterruptedByTimeoutException;
+
+public class InterruptedByTimeoutExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.InterruptedByTimeoutException#InterruptedByTimeoutException()
+     */
+    public void test_empty() {
+        InterruptedByTimeoutException e = new InterruptedByTimeoutException();
+        assertTrue(e instanceof IOException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/ReadPendingExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/ReadPendingExceptionTest.java
new file mode 100644
index 0000000..f05e4cc
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/ReadPendingExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.ReadPendingException;
+
+public class ReadPendingExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.ReadPendingException#ReadPendingException()
+     */
+    public void test_empty() {
+        ReadPendingException e = new ReadPendingException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/ShutdownChannelGroupExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/ShutdownChannelGroupExceptionTest.java
new file mode 100644
index 0000000..0d771cc
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/ShutdownChannelGroupExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.ShutdownChannelGroupException;
+
+public class ShutdownChannelGroupExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.ShutdownChannelGroupException#ShutdownChannelGroupException()
+     */
+    public void test_empty() {
+        ShutdownChannelGroupException e = new ShutdownChannelGroupException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/channels/WritePendingExceptionTest.java b/luni/src/test/java/libcore/java/nio/channels/WritePendingExceptionTest.java
new file mode 100644
index 0000000..463cf8c
--- /dev/null
+++ b/luni/src/test/java/libcore/java/nio/channels/WritePendingExceptionTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package libcore.java.nio.channels;
+
+import junit.framework.TestCase;
+
+import java.nio.channels.WritePendingException;
+
+public class WritePendingExceptionTest extends TestCase {
+
+    /**
+     * java.nio.channels.WritePendingException#WritePendingException()
+     */
+    public void test_empty() {
+        WritePendingException e = new WritePendingException();
+        assertTrue(e instanceof IllegalStateException);
+        assertNull(e.getMessage());
+        assertNull(e.getLocalizedMessage());
+        assertNull(e.getCause());
+    }
+}