1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.apache.harmony.nio.tests.java.nio.channels;
18 import dalvik.annotation.TestTargetNew;
19 import dalvik.annotation.TestTargets;
20 import dalvik.annotation.TestLevel;
21 import dalvik.annotation.TestTargetClass;
23 import java.nio.channels.IllegalSelectorException;
25 import junit.framework.TestCase;
27 import org.apache.harmony.testframework.serialization.SerializationTest;
30 * Tests for IllegalSelectorException
32 @TestTargetClass(IllegalSelectorException.class)
33 public class IllegalSelectorExceptionTest extends TestCase {
36 * @tests {@link java.nio.channels.IllegalSelectorException#IllegalSelectorException()}
38 public void test_Constructor() {
39 IllegalSelectorException e = new IllegalSelectorException();
40 assertNull(e.getMessage());
41 assertNull(e.getLocalizedMessage());
42 assertNull(e.getCause());
46 * @tests serialization/deserialization compatibility.
50 level = TestLevel.COMPLETE,
51 notes = "Verifies serialization/deserialization compatibility.",
52 method = "!SerializationSelf",
56 level = TestLevel.PARTIAL_COMPLETE,
57 notes = "Verifies serialization/deserialization compatibility.",
58 method = "IllegalSelectorException",
62 public void testSerializationSelf() throws Exception {
64 SerializationTest.verifySelf(new IllegalSelectorException());
68 * @tests serialization/deserialization compatibility with RI.
72 level = TestLevel.COMPLETE,
73 notes = "Verifies serialization/deserialization compatibility.",
74 method = "!SerializationGolden",
78 level = TestLevel.PARTIAL_COMPLETE,
79 notes = "Verifies serialization/deserialization compatibility.",
80 method = "IllegalSelectorException",
84 public void testSerializationCompatibility() throws Exception {
86 SerializationTest.verifyGolden(this, new IllegalSelectorException());