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

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

public class AggregateClassLoadingTest
extends BaseJDBCTestCase

Test for ensuring the aggregate implementation classes are loaded correctly, even when the context class loader loads Derby engine classes as well. This is a typical situation we have seen with J2EE servers where Derby may be in the application WAR and provided as a system service by the container.
Jira issue DERBY-997
Assumes embedded and only needs to be run in embedded, since all class loading happens on the engine side.


Field Summary
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
AggregateClassLoadingTest(java.lang.String name)
          Basic constructor.
 
Method Summary
protected  void initializeConnection(java.sql.Connection conn)
          Sets the auto commit to false.
static junit.framework.Test suite()
          Returns the implemented tests.
private  void testAggregate(java.lang.String query)
          Just run and display the aggregates result.
 void testAggregateAVG()
           
 void testAggregateCOUNT()
           
 void testAggregateCOUNT2()
           
 void testAggregateMAX()
           
 void testAggregateMIN()
           
 
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, 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

AggregateClassLoadingTest

public AggregateClassLoadingTest(java.lang.String name)
Basic constructor.

Method Detail

initializeConnection

protected void initializeConnection(java.sql.Connection conn)
                             throws java.sql.SQLException
Sets the auto commit to false.

Overrides:
initializeConnection in class BaseJDBCTestCase
Parameters:
conn - Connection to be intialized
Throws:
java.sql.SQLException - Error setting the initial state.

suite

public static junit.framework.Test suite()
Returns the implemented tests.

Returns:
An instance of Test with the implemented tests to run.

testAggregateMAX

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

testAggregateMIN

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

testAggregateAVG

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

testAggregateCOUNT

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

testAggregateCOUNT2

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

testAggregate

private void testAggregate(java.lang.String query)
                    throws java.sql.SQLException
Just run and display the aggregates result. Test some aggregates, their generated class will attempt to load the internal aggregate through the context loader first, and then any remaining loader.

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.