Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.test.hql
Class QueryTranslatorTestCase  view QueryTranslatorTestCase download QueryTranslatorTestCase.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.hibernate.test.TestCase
              extended byorg.hibernate.test.hql.QueryTranslatorTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ASTQueryTranslatorTest, ClassicTranslatorTest, HQLTest

public abstract class QueryTranslatorTestCase
extends org.hibernate.test.TestCase

Test case superclass for testing QueryTranslator implementations.


Field Summary
 
Fields inherited from class org.hibernate.test.TestCase
SKIP_LOG
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
QueryTranslatorTestCase(java.lang.String x)
           
 
Method Summary
private  void assertSQLEquals(java.lang.String message, java.lang.String oldsql, java.lang.String newsql)
           
 void assertTranslation(java.lang.String hql)
           
 void assertTranslation(java.lang.String hql, boolean scalar)
           
protected  void assertTranslation(java.lang.String hql, java.util.HashMap replacements)
           
protected  void assertTranslation(java.lang.String hql, java.util.HashMap replacements, boolean scalar, java.lang.String sql)
           
private  void checkBinds(java.sql.PreparedStatement oldps, java.sql.PreparedStatement newps, java.lang.Object[] binds)
           
private  void checkColumnNames(org.hibernate.hql.QueryTranslator oldQueryTranslator, org.hibernate.hql.QueryTranslator newQueryTranslator)
           
private  void checkLogicalEquality(java.lang.Object oldval, java.lang.Object newval, org.hibernate.type.Type type)
           
private  void checkQuerySpaces(org.hibernate.hql.QueryTranslator oldQueryTranslator, org.hibernate.hql.QueryTranslator newQueryTranslator)
           
private  void checkResults(java.sql.ResultSet oldrs, java.sql.ResultSet newrs)
           
private  void checkReturnedTypes(org.hibernate.hql.QueryTranslator oldQueryTranslator, org.hibernate.hql.QueryTranslator newQueryTranslator)
           
private  void checkSql(org.hibernate.hql.QueryTranslator oldQueryTranslator, org.hibernate.hql.QueryTranslator newQueryTranslator, java.lang.String hql, boolean scalar, java.lang.String sql)
           
private  void checkSqlByResultSet(org.hibernate.hql.QueryTranslator oldQueryTranslator, org.hibernate.hql.QueryTranslator newQueryTranslator, java.lang.Object[] binds)
           
protected  java.lang.Exception compileBadHql(java.lang.String hql, boolean scalar)
           
protected  org.hibernate.hql.ast.QueryTranslatorImpl createNewQueryTranslator(java.lang.String hql)
           
protected  org.hibernate.hql.ast.QueryTranslatorImpl createNewQueryTranslator(java.lang.String hql, java.util.HashMap replacements, boolean scalar)
           
protected  org.hibernate.engine.query.HQLQueryPlan createQueryPlan(java.lang.String hql)
           
protected  org.hibernate.engine.query.HQLQueryPlan createQueryPlan(java.lang.String hql, boolean scalar)
           
private  java.sql.ResultSet executeQuery(java.sql.PreparedStatement ps, java.lang.Object[] binds)
           
protected  java.lang.String[] getMappings()
           
protected  org.hibernate.engine.SessionFactoryImplementor getSessionFactoryImplementor()
           
private  java.util.Map getTokens(java.lang.String sql)
           
protected  boolean recreateSchema()
           
private  void release(java.sql.PreparedStatement ps)
           
private  void release(java.sql.ResultSet rs)
           
private  void release(org.hibernate.classic.Session session)
           
protected  void runClassicTranslator(java.lang.String hql)
           
private  java.lang.String stripExtraSpaces(java.lang.String string)
           
 
Methods inherited from class org.hibernate.test.TestCase
afterSessionFactoryBuilt, appliesTo, assertClassAssignability, assertElementTypeAssignability, configure, dialectIsCaseSensitive, dialectSupportsEmptyInList, dropAfterFailure, fullTestName, getBaseForMappings, getCacheConcurrencyStrategy, getCfg, getDialect, getExtraProperties, getSessions, openSession, openSession, overrideCacheStrategy, readCommittedIsolationMaintained, reportSkip, reportSkip, runTest, setCfg, setUp, sfi
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, tearDown, 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

QueryTranslatorTestCase

public QueryTranslatorTestCase(java.lang.String x)
Method Detail

assertTranslation

public void assertTranslation(java.lang.String hql)
                       throws org.hibernate.QueryException,
                              org.hibernate.MappingException

assertTranslation

public void assertTranslation(java.lang.String hql,
                              boolean scalar)
                       throws org.hibernate.QueryException,
                              org.hibernate.MappingException

assertTranslation

protected void assertTranslation(java.lang.String hql,
                                 java.util.HashMap replacements)

runClassicTranslator

protected void runClassicTranslator(java.lang.String hql)
                             throws java.lang.Exception

assertTranslation

protected void assertTranslation(java.lang.String hql,
                                 java.util.HashMap replacements,
                                 boolean scalar,
                                 java.lang.String sql)

createNewQueryTranslator

protected org.hibernate.hql.ast.QueryTranslatorImpl createNewQueryTranslator(java.lang.String hql,
                                                                             java.util.HashMap replacements,
                                                                             boolean scalar)

createNewQueryTranslator

protected org.hibernate.hql.ast.QueryTranslatorImpl createNewQueryTranslator(java.lang.String hql)

createQueryPlan

protected org.hibernate.engine.query.HQLQueryPlan createQueryPlan(java.lang.String hql,
                                                                  boolean scalar)

createQueryPlan

protected org.hibernate.engine.query.HQLQueryPlan createQueryPlan(java.lang.String hql)

getSessionFactoryImplementor

protected org.hibernate.engine.SessionFactoryImplementor getSessionFactoryImplementor()

checkColumnNames

private void checkColumnNames(org.hibernate.hql.QueryTranslator oldQueryTranslator,
                              org.hibernate.hql.QueryTranslator newQueryTranslator)

checkReturnedTypes

private void checkReturnedTypes(org.hibernate.hql.QueryTranslator oldQueryTranslator,
                                org.hibernate.hql.QueryTranslator newQueryTranslator)

checkQuerySpaces

private void checkQuerySpaces(org.hibernate.hql.QueryTranslator oldQueryTranslator,
                              org.hibernate.hql.QueryTranslator newQueryTranslator)

compileBadHql

protected java.lang.Exception compileBadHql(java.lang.String hql,
                                            boolean scalar)

checkSql

private void checkSql(org.hibernate.hql.QueryTranslator oldQueryTranslator,
                      org.hibernate.hql.QueryTranslator newQueryTranslator,
                      java.lang.String hql,
                      boolean scalar,
                      java.lang.String sql)

assertSQLEquals

private void assertSQLEquals(java.lang.String message,
                             java.lang.String oldsql,
                             java.lang.String newsql)

getTokens

private java.util.Map getTokens(java.lang.String sql)

stripExtraSpaces

private java.lang.String stripExtraSpaces(java.lang.String string)

checkSqlByResultSet

private void checkSqlByResultSet(org.hibernate.hql.QueryTranslator oldQueryTranslator,
                                 org.hibernate.hql.QueryTranslator newQueryTranslator,
                                 java.lang.Object[] binds)

checkBinds

private void checkBinds(java.sql.PreparedStatement oldps,
                        java.sql.PreparedStatement newps,
                        java.lang.Object[] binds)

executeQuery

private java.sql.ResultSet executeQuery(java.sql.PreparedStatement ps,
                                        java.lang.Object[] binds)
                                 throws java.sql.SQLException

checkResults

private void checkResults(java.sql.ResultSet oldrs,
                          java.sql.ResultSet newrs)

checkLogicalEquality

private void checkLogicalEquality(java.lang.Object oldval,
                                  java.lang.Object newval,
                                  org.hibernate.type.Type type)

release

private void release(java.sql.PreparedStatement ps)

release

private void release(java.sql.ResultSet rs)

release

private void release(org.hibernate.classic.Session session)

getMappings

protected java.lang.String[] getMappings()

recreateSchema

protected boolean recreateSchema()