net.sf.farrago.test
Class FarragoQueryTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.test.DiffTestCase
              extended by net.sf.farrago.test.ResultSetTestCase
                  extended by net.sf.farrago.test.FarragoTestCase
                      extended by net.sf.farrago.test.FarragoQueryTest
All Implemented Interfaces:
Test

public class FarragoQueryTest
extends FarragoTestCase

FarragoQueryTest tests miscellaneous aspects of Farrago query processing which are impossible to test via SQL scripts.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/test/FarragoQueryTest.java#49 $
Author:
John V. Sichi

Nested Class Summary
private static class FarragoQueryTest.TxnListener
           
 
Nested classes/interfaces inherited from class net.sf.farrago.test.FarragoTestCase
FarragoTestCase.Cleanup, FarragoTestCase.CleanupFactory
 
Field Summary
 
Fields inherited from class net.sf.farrago.test.FarragoTestCase
allocOwner, connection, preparedStmt, repos, stmt, tracer
 
Fields inherited from class net.sf.farrago.test.ResultSetTestCase
resultSet
 
Fields inherited from class org.eigenbase.test.DiffTestCase
logFile, logOutputStream, refFile
 
Constructor Summary
FarragoQueryTest(String testName)
          Creates a new FarragoQueryTest object.
 
Method Summary
private  boolean checkLurqlSecurityRoleCycle(String lurql, String granteeName, String grantedRoleName)
           
private  void checkLurqlTableSchema(String lurql, String tableName, String schemaName)
           
private  String fetchLobText(String mofId, String attributeName)
           
private  String getSchemaMofId(String schemaName, StringBuilder descriptionOut)
           
static Test suite()
           
 void testAbandonedResultSet()
           
 void testAutocommitCursorLimit()
          Verifies non-standard behavior preventing more than one statement active at a time in autocommit mode.
 void testCheckSecurityRoleCyleLurqlQuery()
          Tests execution of a LURQL query to check role cycle.
 void testDateTimeOverLocalJdbc()
          Tests that ResultSet.getObject(int) implementation in farrago returns a distinct object for a ZonelessDateTime type column in each new row.
 void testDynamicParamInUdx()
          Tests a query which involves a dynamic parameter in the FROM clause.
 void testInternalLurqlQuery()
          Tests execution of an internal LURQL query defined in a resource file.
 void testLobTextUdxEmptyString()
           
 void testLobTextUdxMultiChunk()
           
 void testLobTextUdxNull()
           
 void testLobTextUdxOneChunk()
           
 void testNoAutocommitCursorLimit()
          Verifies that multiple statements can be active when not in autocommit mode.
 void testNoNativeTraceLeak()
           
 void testOrderByVarbinary()
          Tests a query which involves sorting VARBINARY values.
 void testPrimitiveColumnOperation()
          Tests a query which involves operation on columns.
 void testRelMetadata()
          Tests relational expression metadata derivation via FarragoSession.analyzeSql.
 void testSetCatalog()
          Tests a query using a different catalog.
 void testTxnMgrListener()
          Tests that the transaction manager correctly notifies listeners of table accesses.
 void testUdxRelMetadata()
           
 void testUdxReturnsColListParamRelMetadata()
           
 void testUnencodableUnicodeLiteral()
           
 void testUnicodeLiteral()
           
 void testVarbinaryComparison()
          Tests a query which involves comparison with VARBINARY values.
 
Methods inherited from class net.sf.farrago.test.FarragoTestCase
forceShutdown, getJdbcUri, getSession, getTestlogRoot, getTestlogRootStatic, newConnection, newJdbcEngineDriver, restoreParameters, restoreParameters, runCleanup, runSqlLineTest, runSqlLineTest, saveParameters, saveParameters, setRefFileDiffMasks, setUp, shouldDiff, staticSetUp, staticTearDown, tearDown, tearDownImpl, wrappedSuite, wrappedSuite
 
Methods inherited from class net.sf.farrago.test.ResultSetTestCase
compareResultList, compareResultLists, compareResultSet, compareResultSetWithDelta, compareResultSetWithPattern, getResultSetCount
 
Methods inherited from class org.eigenbase.test.DiffTestCase
addDiffMask, addIgnorePattern, diffFile, diffLines, diffTestLog, fileContents, openTestLog, openTestLogOutputStream, setGC, setVerbose
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FarragoQueryTest

public FarragoQueryTest(String testName)
                 throws Exception
Creates a new FarragoQueryTest object.

Parameters:
testName - JUnit test name
Throws:
Exception - .
Method Detail

suite

public static Test suite()

testPrimitiveColumnOperation

public void testPrimitiveColumnOperation()
                                  throws Exception
Tests a query which involves operation on columns.

Throws:
Exception

testVarbinaryComparison

public void testVarbinaryComparison()
                             throws Exception
Tests a query which involves comparison with VARBINARY values.

Throws:
Exception

testDynamicParamInUdx

public void testDynamicParamInUdx()
                           throws Exception
Tests a query which involves a dynamic parameter in the FROM clause.

Throws:
Exception

testOrderByVarbinary

public void testOrderByVarbinary()
                          throws Exception
Tests a query which involves sorting VARBINARY values.

Throws:
Exception

testSetCatalog

public void testSetCatalog()
                    throws Exception
Tests a query using a different catalog.

Throws:
Exception

testInternalLurqlQuery

public void testInternalLurqlQuery()
                            throws Exception
Tests execution of an internal LURQL query defined in a resource file.

Throws:
Exception

testAutocommitCursorLimit

public void testAutocommitCursorLimit()
                               throws Exception
Verifies non-standard behavior preventing more than one statement active at a time in autocommit mode.

Throws:
Exception

testNoAutocommitCursorLimit

public void testNoAutocommitCursorLimit()
                                 throws Exception
Verifies that multiple statements can be active when not in autocommit mode.

Throws:
Exception

checkLurqlTableSchema

private void checkLurqlTableSchema(String lurql,
                                   String tableName,
                                   String schemaName)
                            throws Exception
Throws:
Exception

testCheckSecurityRoleCyleLurqlQuery

public void testCheckSecurityRoleCyleLurqlQuery()
                                         throws Exception
Tests execution of a LURQL query to check role cycle. If role_2 has been granted to role_1, then role_1 can't be granted to role_2. This query expanded all the roles inherited by a specified input role, the test then scans through the inherited roles to ensure that a second specified role (to be granted to the first specified role) does not exist.

Throws:
Exception

checkLurqlSecurityRoleCycle

private boolean checkLurqlSecurityRoleCycle(String lurql,
                                            String granteeName,
                                            String grantedRoleName)
                                     throws Exception
Throws:
Exception

testAbandonedResultSet

public void testAbandonedResultSet()
                            throws Exception
Throws:
Exception

testRelMetadata

public void testRelMetadata()
                     throws Exception
Tests relational expression metadata derivation via FarragoSession.analyzeSql.

Throws:
Exception

testUdxRelMetadata

public void testUdxRelMetadata()
                        throws Exception
Throws:
Exception

testUdxReturnsColListParamRelMetadata

public void testUdxReturnsColListParamRelMetadata()
                                           throws Exception
Throws:
Exception

testTxnMgrListener

public void testTxnMgrListener()
                        throws Exception
Tests that the transaction manager correctly notifies listeners of table accesses.

Throws:
Exception

testDateTimeOverLocalJdbc

public void testDateTimeOverLocalJdbc()
                               throws Exception
Tests that ResultSet.getObject(int) implementation in farrago returns a distinct object for a ZonelessDateTime type column in each new row.

Throws:
Exception

testLobTextUdxNull

public void testLobTextUdxNull()
                        throws Exception
Throws:
Exception

testLobTextUdxEmptyString

public void testLobTextUdxEmptyString()
                               throws Exception
Throws:
Exception

testLobTextUdxOneChunk

public void testLobTextUdxOneChunk()
                            throws Exception
Throws:
Exception

testLobTextUdxMultiChunk

public void testLobTextUdxMultiChunk()
                              throws Exception
Throws:
Exception

getSchemaMofId

private String getSchemaMofId(String schemaName,
                              StringBuilder descriptionOut)

fetchLobText

private String fetchLobText(String mofId,
                            String attributeName)
                     throws Exception
Throws:
Exception

testNoNativeTraceLeak

public void testNoNativeTraceLeak()
                           throws Exception
Throws:
Exception

testUnicodeLiteral

public void testUnicodeLiteral()
                        throws Exception
Throws:
Exception

testUnencodableUnicodeLiteral

public void testUnencodableUnicodeLiteral()