Examples of SerialClob


Examples of javax.sql.rowset.serial.SerialClob

    public void testSetAsciiStream() throws Exception {
        MockSerialClob mockClob = new MockSerialClob();
        mockClob.characterStreamReader = new CharArrayReader(mockClob.buf);
        mockClob.asciiInputStream = new ByteArrayInputStream(new byte[] { 1 });
        SerialClob serialClob = new SerialClob(mockClob);
        OutputStream os = null;
        try {
            os = serialClob.setAsciiStream(1);
            fail("should throw SerialException");
        } catch (SerialException e) {
            // expected
        }
        mockClob.asciiOutputStream = new ByteArrayOutputStream();
        os = serialClob.setAsciiStream(1);
        assertNotNull(os);
        assertTrue(mockClob.isSetAsciiStreamInvoked);
        assertEquals(mockClob.asciiOutputStream, os);

        try {
            serialClob = new SerialClob("helloo".toCharArray());
            // Harmony-3491, non bug difference from RI
            serialClob.setAsciiStream(1);
            fail("should throw SerialException");
        } catch (SerialException e) {
            // expected
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.