1dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes/* Licensed to the Apache Software Foundation (ASF) under one or more 2dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * contributor license agreements. See the NOTICE file distributed with 3dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * this work for additional information regarding copyright ownership. 4dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * The ASF licenses this file to You under the Apache License, Version 2.0 5dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * (the "License"); you may not use this file except in compliance with 6dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * the License. You may obtain a copy of the License at 7dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * 8dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * http://www.apache.org/licenses/LICENSE-2.0 9dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * 10dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * Unless required by applicable law or agreed to in writing, software 11dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS, 12dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * See the License for the specific language governing permissions and 14dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * limitations under the License. 15dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 16dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 17e5fea3d504609d22337a5311d3ce0e72314bceeeNarayan Kamathpackage org.apache.harmony.tests.java.nio; 18dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 19dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughesimport java.nio.BufferUnderflowException; 20dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 21dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughesimport junit.framework.TestCase; 22dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 23dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughesimport org.apache.harmony.testframework.serialization.SerializationTest; 24dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 25dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes/** 26dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * Tests for BufferUnderflowException 27dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 28dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughespublic class BufferUnderflowExceptionTest extends TestCase { 29dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 30dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes /** 31dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * @tests serialization/deserialization compatibility. 32dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 33dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes public void testSerializationSelf() throws Exception { 34dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 35dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes SerializationTest.verifySelf(new BufferUnderflowException()); 36dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes } 37dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 38dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes /** 39dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes * @tests serialization/deserialization compatibility with RI. 40dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 41dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes public void testSerializationCompatibility() throws Exception { 42dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 43dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes SerializationTest.verifyGolden(this, new BufferUnderflowException()); 44dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes } 45dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes 46dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes /** 47dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes *@tests {@link java.nio.BufferUnderflowException#BufferUnderflowException()} 48dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes */ 49dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes public void test_Constructor() { 50dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes BufferUnderflowException exception = new BufferUnderflowException(); 51dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes assertNull(exception.getMessage()); 52dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes assertNull(exception.getLocalizedMessage()); 53dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes assertNull(exception.getCause()); 54dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes } 55dce2b2fa9d6b26414a8d5a55918e4d7ca2ab1baaElliott Hughes} 56