org.apache.derbyTesting.functionTests.tests.lang
Class AnsiTrimTest

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.lang.AnsiTrimTest
All Implemented Interfaces:
junit.framework.Test

public class AnsiTrimTest
extends BaseJDBCTestCase

Functional test for ansi trim functionality added for DERBY-1623.

Since:
May 6, 2007

Field Summary
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
AnsiTrimTest(java.lang.String name)
          Create a test case with the given name.
 
Method Summary
static void decorate(java.sql.Statement s)
           
private  void positiveTest(java.lang.String sql, java.lang.Object expected)
           
static junit.framework.Test suite()
           
 void testCharIsNull()
           
 void testColumnsWithConstant()
          trim a column with a constant trim char.
 void testSourceIsEmpty()
           
 void testSourceIsNull()
           
 void testSourceIsSingleChar()
           
 void testTrimCharIsExpr()
          Use a few expressions as the trim character.
 void testTrimFromClobColumn()
          A clob column is the input source.
 void testTrimResultIsEmpty()
          All the characters are trimmed.
 void testTrimSourceIsExpr()
          Use a few different expressions as the trim source.
 
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
 

Constructor Detail

AnsiTrimTest

public AnsiTrimTest(java.lang.String name)
Create a test case with the given name.

Parameters:
name - of the test case.
Method Detail

decorate

public static void decorate(java.sql.Statement s)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

suite

public static junit.framework.Test suite()

testColumnsWithConstant

public void testColumnsWithConstant()
                             throws java.sql.SQLException
trim a column with a constant trim char.

Throws:
java.sql.SQLException

testTrimCharIsExpr

public void testTrimCharIsExpr()
                        throws java.sql.SQLException
Use a few expressions as the trim character.

Throws:
java.sql.SQLException

testTrimFromClobColumn

public void testTrimFromClobColumn()
                            throws java.sql.SQLException,
                                   java.io.IOException
A clob column is the input source.

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

testTrimSourceIsExpr

public void testTrimSourceIsExpr()
                          throws java.sql.SQLException
Use a few different expressions as the trim source.

Throws:
java.sql.SQLException

testTrimResultIsEmpty

public void testTrimResultIsEmpty()
                           throws java.sql.SQLException
All the characters are trimmed.

Throws:
java.sql.SQLException

testSourceIsEmpty

public void testSourceIsEmpty()
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

testSourceIsNull

public void testSourceIsNull()
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

testSourceIsSingleChar

public void testSourceIsSingleChar()
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

testCharIsNull

public void testCharIsNull()
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

positiveTest

private void positiveTest(java.lang.String sql,
                          java.lang.Object expected)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

Built on Sat 2009-11-28 18:44:18-0800, from revision 885187

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