harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r545054 - in /harmony/enhanced/classlib/branches/java6/modules/luni/src: main/java/java/io/ test/java/org/apache/harmony/luni/tests/java/io/ test/resources/serialization/org/apache/harmony/luni/tests/java/io/
Date Thu, 07 Jun 2007 03:50:45 GMT
Author: pyang
Date: Wed Jun  6 20:50:44 2007
New Revision: 545054

URL: http://svn.apache.org/viewvc?view=rev&rev=545054
Log:
Apply patch for HARMONY-4057([classlib][luni][java6]new class java.io.IOError)

Added:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/IOError.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/IOErrorTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/io/IOErrorTest.golden.ser
  (with props)

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/IOError.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/IOError.java?view=auto&rev=545054
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/IOError.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/IOError.java
Wed Jun  6 20:50:44 2007
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 java.io;
+
+/**
+ * This error is thrown when a severe I/O error has happened.
+ * 
+ * @since 1.6
+ */
+public class IOError extends Error {
+    private static final long serialVersionUID = 67100927991680413L;
+
+    /**
+     * Constructs a new instance with its cause filled in.
+     * 
+     * @param cause
+     *            The detail cause for the error.
+     */
+    public IOError(Throwable cause) {
+        super(cause);
+    }
+}

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/IOErrorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/IOErrorTest.java?view=auto&rev=545054
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/IOErrorTest.java
(added)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/IOErrorTest.java
Wed Jun  6 20:50:44 2007
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 org.apache.harmony.luni.tests.java.io;
+
+import java.io.IOError;
+
+import org.apache.harmony.testframework.serialization.SerializationTest;
+
+import junit.framework.TestCase;
+
+public class IOErrorTest extends TestCase {
+
+    /**
+     * @tests java.io.IOError#IOError(java.lang.Throwable)
+     * @since 1.6
+     */
+    public void test_IOError_LThrowable() {
+        IOError e = new IOError(null);
+        assertNull(e.getCause());
+        
+        String errorMsg = "java.io.IOError"; //$NON-NLS-1$
+        assertTrue(e.toString().contains(errorMsg));
+        
+        errorMsg = "A dummy error"; //$NON-NLS-1$
+        e = new IOError(new Throwable(errorMsg));
+        assertTrue(e.toString().contains(errorMsg));
+        
+        try {
+            throw new IOError(null);
+        }catch(IOError error) {
+            return;
+        }catch(Error error) {
+            fail("Error during IOException test" + error.toString()); //$NON-NLS-1$
+        }
+        fail("Failed to generate error"); //$NON-NLS-1$
+    }
+    
+    /**
+     * @tests serialization/deserialization.
+     * @since 1.6
+     */
+    public void testSerializationSelf() throws Exception {
+        String errorMsg = "java.io.IOError";
+        IOError e = new IOError(new Throwable(errorMsg));
+        SerializationTest.verifySelf(e);
+    }
+    
+    /**
+     * @tests serialization/deserialization compatibility with RI.
+     * @since 1.6
+     */
+    public void testSerializationCompatibility() throws Exception {
+        String errorMsg = "java.io.IOError";
+        IOError e = new IOError(new Throwable(errorMsg));
+        SerializationTest.verifyGolden(this, e);
+    }
+
+}

Added: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/io/IOErrorTest.golden.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/io/IOErrorTest.golden.ser?view=auto&rev=545054
==============================================================================
Binary file - no diff available.

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/io/IOErrorTest.golden.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message