Name: ssR10000 Date: 09/16/2003
Filed By : SPB JCK team (###@###.###)
JDK : java full version "1.5.0-beta-b18"
JCK : 1.5
Platform[s] : Solaris
switch/Mode :
JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
Failing Test [s] : N/A
Problem description
===================
There is some problems with SerialClob class:
1. Useless constructor:
The spec. says:
Retrieves a stream to be used to write Ascii characters to the
CLOB value that this Clob object represents, starting at position pos.
pos - the position at which to start writing to this CLOB object
return the stream to which ASCII encoded characters can be written
public java.io.OutputStream setAsciiStream(long pos) throws SerialException {
//throw new UnsupportedOperationException();
ByteArrayOutputStream baoStream = new ByteArrayOutputStream((int)pos);
return (java.io.OutputStream)baoStream;
}
but there is no way to "write Ascii characters to the CLOB value" using
returned stream. Moreover JavaDoc for ByteArrayOutputStream says:
ByteArrayOutputStream(int size)
Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
So, ByteArrayOutputStream(int) parameter it is size but not a position.
Also it is good idea to tie internal CLOB buffer to the returned stream.
2. The same with next one:
public java.io.Writer setCharacterStream(long pos) throws SerialException {
// throw new UnsupportedOperationException();
CharArrayWriter caWriter = new CharArrayWriter((int)pos);
//caWriter.buf = buf;
//caWriter.count = buf.length;
return (java.io.Writer)caWriter;
}
A lot of JCK tests failed due to these problems:
api/javax_sql/rowset/serial/SerialClob/index.html#Main[SerialClob2002]
api/javax_sql/rowset/serial/SerialClob/index.html#Main[SerialClob2003]
api/javax_sql/rowset/serial/SerialClob/index.html#Main[SerialClob2004]
JCK test source location:
==========================
/java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests
======================================================================
- relates to
-
JDK-4991036 The class javax.sql.rowset.serial.SerialClob is too buggy
-
- Closed
-