harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apavle...@apache.org
Subject svn commit: r585456 - /harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/FilterOutputStream/FilterOutputStreamTestShared.java
Date Wed, 17 Oct 2007 12:28:55 GMT
Author: apavlenko
Date: Wed Oct 17 05:28:41 2007
New Revision: 585456

URL: http://svn.apache.org/viewvc?rev=585456&view=rev
Log:
Patch for HARMONY-4864 ([buildtest][func] The test FilterOutputStreamTestShared is incorrect)

Modified:
    harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/FilterOutputStream/FilterOutputStreamTestShared.java

Modified: harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/FilterOutputStream/FilterOutputStreamTestShared.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/FilterOutputStream/FilterOutputStreamTestShared.java?rev=585456&r1=585455&r2=585456&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/FilterOutputStream/FilterOutputStreamTestShared.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/io/share/FilterOutputStream/FilterOutputStreamTestShared.java
Wed Oct 17 05:28:41 2007
@@ -22,6 +22,7 @@
 import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.lang.reflect.Field;
 
 import org.apache.harmony.test.func.api.java.io.share.OutputStream.OutputStreamTestShared;
 import org.apache.harmony.test.func.api.java.io.share.MockOutputStream;
@@ -29,16 +30,22 @@
 import org.apache.harmony.share.Result;
 
 public class FilterOutputStreamTestShared extends OutputStreamTestShared {
-    OutputStream underlyingStream = null;
     
     protected OutputStream getTestedOutputStream(int maxSize)
             throws IOException {
-        underlyingStream = super.getTestedOutputStream(maxSize);
-        return getOutputStream(underlyingStream);
+        return getOutputStream(super.getTestedOutputStream(maxSize));
     }
 
     protected String getWrittenAsString(OutputStream os) {
-        return super.getWrittenAsString(underlyingStream);
+        try {
+            final Field c = FilterOutputStream.class.getDeclaredField("out");
+            
+	    c.setAccessible(true);
+            return super.getWrittenAsString((OutputStream) c.get(os));
+        } catch(Exception ex) {
+            ex.printStackTrace();
+            return null;
+        }
     }
     
     protected OutputStream getOutputStream(OutputStream os) {



Mime
View raw message