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.
17 package org.apache.harmony.nio.tests.java.nio;
19 import dalvik.annotation.TestTargets;
20 import dalvik.annotation.TestLevel;
21 import dalvik.annotation.TestTargetNew;
22 import dalvik.annotation.TestTargetClass;
24 import java.nio.BufferUnderflowException;
26 import junit.framework.TestCase;
28 import org.apache.harmony.testframework.serialization.SerializationTest;
31 * Tests for BufferUnderflowException
33 @TestTargetClass(BufferUnderflowException.class)
34 public class BufferUnderflowExceptionTest extends TestCase {
37 * @tests serialization/deserialization compatibility.
41 level = TestLevel.COMPLETE,
42 notes = "Verifies serialization/deserialization compatibility.",
43 method = "!SerializationSelf",
47 level = TestLevel.PARTIAL_COMPLETE,
49 method = "BufferUnderflowException",
53 public void testSerializationSelf() throws Exception {
55 SerializationTest.verifySelf(new BufferUnderflowException());
59 * @tests serialization/deserialization compatibility with RI.
63 level = TestLevel.COMPLETE,
64 notes = "Verifies serialization/deserialization compatibility.",
65 method = "!SerializationGolden",
69 level = TestLevel.PARTIAL_COMPLETE,
71 method = "BufferUnderflowException",
75 public void testSerializationCompatibility() throws Exception {
77 SerializationTest.verifyGolden(this, new BufferUnderflowException());
81 *@tests {@link java.nio.BufferUnderflowException#BufferUnderflowException()}
84 level = TestLevel.PARTIAL_COMPLETE,
86 method = "BufferUnderflowException",
89 public void test_Constructor() {
90 BufferUnderflowException exception = new BufferUnderflowException();
91 assertNull(exception.getMessage());
92 assertNull(exception.getLocalizedMessage());
93 assertNull(exception.getCause());