OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / libcore / luni / src / test / java / org / apache / harmony / nio / tests / java / nio / channels / IllegalSelectorExceptionTest.java
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.apache.harmony.nio.tests.java.nio.channels;
17
18 import dalvik.annotation.TestTargetNew;
19 import dalvik.annotation.TestTargets;
20 import dalvik.annotation.TestLevel;
21 import dalvik.annotation.TestTargetClass;
22
23 import java.nio.channels.IllegalSelectorException;
24
25 import junit.framework.TestCase;
26
27 import org.apache.harmony.testframework.serialization.SerializationTest;
28
29 /**
30  * Tests for IllegalSelectorException
31  */
32 @TestTargetClass(IllegalSelectorException.class)
33 public class IllegalSelectorExceptionTest extends TestCase {
34
35     /**
36      * @tests {@link java.nio.channels.IllegalSelectorException#IllegalSelectorException()}
37      */
38     public void test_Constructor() {
39         IllegalSelectorException e = new IllegalSelectorException();
40         assertNull(e.getMessage());
41         assertNull(e.getLocalizedMessage());
42         assertNull(e.getCause());
43     }
44
45     /**
46      * @tests serialization/deserialization compatibility.
47      */
48     @TestTargets({
49         @TestTargetNew(
50             level = TestLevel.COMPLETE,
51             notes = "Verifies serialization/deserialization compatibility.",
52             method = "!SerializationSelf",
53             args = {}
54         ),
55         @TestTargetNew(
56             level = TestLevel.PARTIAL_COMPLETE,
57             notes = "Verifies serialization/deserialization compatibility.",
58             method = "IllegalSelectorException",
59             args = {}
60         )
61     })
62     public void testSerializationSelf() throws Exception {
63
64         SerializationTest.verifySelf(new IllegalSelectorException());
65     }
66
67     /**
68      * @tests serialization/deserialization compatibility with RI.
69      */
70     @TestTargets({
71         @TestTargetNew(
72             level = TestLevel.COMPLETE,
73             notes = "Verifies serialization/deserialization compatibility.",
74             method = "!SerializationGolden",
75             args = {}
76         ),
77         @TestTargetNew(
78             level = TestLevel.PARTIAL_COMPLETE,
79             notes = "Verifies serialization/deserialization compatibility.",
80             method = "IllegalSelectorException",
81             args = {}
82         )
83     })
84     public void testSerializationCompatibility() throws Exception {
85
86         SerializationTest.verifyGolden(this, new IllegalSelectorException());
87     }
88 }