harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r542438 - in /harmony/enhanced/classlib/branches/java6/modules/luni/src: main/java/java/io/PrintStream.java test/java/tests/api/java/io/PrintStreamTest.java
Date Tue, 29 May 2007 07:14:07 GMT
Author: apetrenko
Date: Tue May 29 00:14:06 2007
New Revision: 542438

URL: http://svn.apache.org/viewvc?view=rev&rev=542438
Log:
Patch for HARMONY-3724 "[classlib][luni][java6]add new method to j.i.PrintStream"

Modified:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java?view=diff&rev=542438&r1=542437&r2=542438
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PrintStream.java
Tue May 29 00:14:06 2007
@@ -232,6 +232,15 @@
         }
         return ioError;
     }
+    
+    /**
+     * Sets the error state of the stream to false.
+     * 
+     * @since 1.6
+     */
+    protected void clearError() {
+        ioError = false;
+    }
 
     /**
      * Close this PrintStream. This implementation flushes and then closes the

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java?view=diff&rev=542438&r1=542437&r2=542438
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
Tue May 29 00:14:06 2007
@@ -53,7 +53,12 @@
 		public MockPrintStream(OutputStream os) {
 			super(os);
 		}
-		
+        
+        @Override
+        public void clearError() {
+            super.clearError();
+        }
+        
 		@Override
 		public void setError() {
 			super.setError();
@@ -126,6 +131,19 @@
         assertTrue("Checkerror should return true", os.checkError());
     }
 
+    /**
+     * @tests {@link java.io.PrintStream#clearError()} 
+     */
+    public void test_clearError() throws FileNotFoundException {        
+        MockPrintStream os = new MockPrintStream(testFilePath);     
+        assertFalse(os.checkError());
+        os.setError();
+        assertTrue(os.checkError());
+        os.clearError();
+        assertFalse(os.checkError());
+        os.close();
+    }
+    
     /**
      * @tests java.io.PrintStream#close()
      */



Mime
View raw message