org.apache.derbyTesting.functionTests.tests.jdbcapi
Class ResultSetStreamTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.derbyTesting.junit.BaseTestCase
              extended by org.apache.derbyTesting.junit.BaseJDBCTestCase
                  extended by org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetStreamTest
All Implemented Interfaces:
junit.framework.Test

public class ResultSetStreamTest
extends BaseJDBCTestCase


Field Summary
private static java.lang.String filePath
           
private static java.lang.String sep
           
(package private) static java.lang.String TEST_STRING_DATA
           
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
ResultSetStreamTest(java.lang.String name)
           
 
Method Summary
private  void assertMisMatchStreamLength(java.sql.SQLException sqle)
           
static junit.framework.Test basesuite(java.lang.String name)
           
 void binaryStreamProcessing()
          Test getBinaryStream by comparing chksum of retrieved value.
private static java.lang.String drainStringFromSource(java.io.Reader src)
          Drains the specified reader and returns a string.
private  void insertData()
          Test insert of data with setBinaryStream
static junit.framework.Test suite()
           
 void testBinaryStreamProcessing()
           
 void testGetAsciiStream()
           
 void testGetCharacterStream()
          test getCharacterStream against inserted data
 void testInsertData()
           
 void testSetMaxFieldSizeLarge()
          Tests that the max field size limit is handled correctly when accessing values as streams.
 
Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestCase
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertTableRowCount, assertUpdateCount, assertUpdateCount, checkAllConsistency, checkEstimatedRowCount, commit, createStatement, createStatement, createStatement, dropTable, dropTable, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
 
Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filePath

private static java.lang.String filePath

sep

private static java.lang.String sep

TEST_STRING_DATA

static final java.lang.String TEST_STRING_DATA
See Also:
Constant Field Values
Constructor Detail

ResultSetStreamTest

public ResultSetStreamTest(java.lang.String name)
Method Detail

testInsertData

public void testInsertData()
                    throws java.sql.SQLException,
                           java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

insertData

private void insertData()
                 throws java.sql.SQLException,
                        java.io.FileNotFoundException,
                        java.io.IOException
Test insert of data with setBinaryStream

Throws:
java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException

assertMisMatchStreamLength

private void assertMisMatchStreamLength(java.sql.SQLException sqle)

testBinaryStreamProcessing

public void testBinaryStreamProcessing()
                                throws java.sql.SQLException,
                                       java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

binaryStreamProcessing

public void binaryStreamProcessing()
                            throws java.sql.SQLException,
                                   java.io.IOException
Test getBinaryStream by comparing chksum of retrieved value.

Throws:
java.sql.SQLException
java.io.IOException

testGetAsciiStream

public void testGetAsciiStream()
                        throws java.sql.SQLException,
                               java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

testGetCharacterStream

public void testGetCharacterStream()
                            throws java.sql.SQLException,
                                   java.io.IOException
test getCharacterStream against inserted data

Throws:
java.sql.SQLException
java.io.IOException

testSetMaxFieldSizeLarge

public void testSetMaxFieldSizeLarge()
                              throws java.io.IOException,
                                     java.sql.SQLException
Tests that the max field size limit is handled correctly when accessing values as streams. The limit should apply for VARCHAR, but not for CLOB.

Throws:
java.io.IOException - if something goes wrong
java.sql.SQLException - if something goes wrong

drainStringFromSource

private static java.lang.String drainStringFromSource(java.io.Reader src)
                                               throws java.io.IOException
Drains the specified reader and returns a string.

Parameters:
src - the reader to drain
Returns:
The reader content as a string.
Throws:
java.io.IOException - if reading from the source fails

basesuite

public static junit.framework.Test basesuite(java.lang.String name)

suite

public static junit.framework.Test suite()

Built on Wed 2009-11-25 18:43:31-0800, from revision 884373

Apache Derby V10.6 Internals - Copyright © 2004,2008 The Apache Software Foundation. All Rights Reserved.