org.apache.ojb.broker
Class QueryTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.ojb.broker.QueryTest
All Implemented Interfaces:
junit.framework.Test

public class QueryTest
extends junit.framework.TestCase

Testing the query API


Field Summary
(package private)  PersistenceBroker broker
           
 
Constructor Summary
QueryTest(java.lang.String name)
          BrokerTests constructor comment.
 
Method Summary
 void _testReportQueryWithStartAndEnd()
          Simple ReportQuery returning rows with 2 columns of Person needs SQL paging
static void main(java.lang.String[] args)
          Insert the method's description here.
 void setUp()
          Insert the method's description here.
 void tearDown()
          Insert the method's description here.
 void testBetweenCriteria()
          test Between Criteria
 void testCriteria()
          Criteria containing other Criteria only
 void testDistinct()
          Distinct Query
 void testDistinctMultiPk()
          Distinct Query
 void testEqualCriteria()
          test EqualTo Criteria
 void testInCriteria()
          test In Criteria
 void testInversePathExpression()
          Read a CD and then read the ProductGroup for the CD
 void testLikeCriteria()
          test Like Criteria
 void testLikeEscapedCriteria1()
          test escaped Like Criteria
 void testLikeEscapedCriteria2()
          test escaped Like Criteria with escape character
 void testMultipleJoins()
          Test multiple non nested joins using pathExpressions
 void testNestedJoins()
          Test nested joins using pathExpressions
 void testNullCriteria()
          test Null Criteria
 void testPathExpressionForAbstractExtent()
          test PathExpression pointing to abstract class (InterfaceArticle)
 void testPathExpressionForExtents1()
          Test pathExpression and Extents
 void testPathExpressionForExtents2()
          Test pathExpression and Extents
 void testPathExpressionForExtents3()
          Test pathExpression and Extents musicians is only defined in CD
 void testPathExpressionForExtents4()
          Test pathExpression and Extents Abstract Base
 void testPathExpressionForExtentsAlias()
          Test pathExpression and Extents using Alias
 void testPathExpressions()
          Single Path Expression
 void testPathExpressionsMtoN()
          Multi Path Expression over nondecomposed m:n
 void testPathExpressionsMtoN2()
          Multi Path Expression over nondecomposed m:n new test case for the 'not unique alias' problem with m:n relationship
 void testPathExpressionsMtoNDecomposed()
          Multi Path Expression over decomposed m:n
 void testPrefetchedArraySingleKey()
          prefetch Articles for ProductGroupsWithArray, Does not yet work with Arrays
 void testPrefetchedCollectionSingleKey()
          prefetch Articles for ProductGroups
 void testPrefetchedReferencesSingleKey()
          prefetch ProductGroups for Articles
 void testQueryMN_Alias1()
           
 void testQueryMN_Alias2()
           
 void testQueryMN()
           
 void testQueryOrderByNonSelectColumn()
          ReportQuery returning rows with some "Liquor" data ordered by productGroup.groupId
 void testQueryRangeAllRecords()
          Run a query range test that includes all of the records that exist.
 void testQueryRangeOneLessThanTotal()
          Run a query range test that includes one record less than the total number of records that exist.
 void testQueryRangeOneMoreThanTotal()
          Run a query range test that includes one record more than the total number of records that exist.
 void testReportPathExpressionForExtents1()
          Test pathExpression and Extents
 void testReportPathExpressionForExtents2()
          Test pathExpression and Extents
 void testReportQuery()
          Simple ReportQuery returning rows with 3 columns of Person
 void testReportQueryExtent()
          Simple ReportQuery returning rows with 2 columns of Person
 void testReportQueryGroupBy()
          ReportQuery returning rows with summed stock and price per article group
 void testReportQueryOrderBy()
          ReportQuery returning rows with some "Liquor" data ordered by price
 void testReportQueryOrderByNonSelectColumn()
          ReportQuery returning rows with some "Liquor" data ordered by productGroup.groupId
 void testReportQueryPathExpression()
          ReportQuery with pathExpression in columns
 void testReportQueryWithJdbcTypes()
          Simple ReportQuery returning rows with 3 columns of Person Type of column data defined by sqltypes
 void testSubQuery1()
          test Subquery get all articles with price > avg(price) PROBLEM: avg(price) is NOT extent aware !! test may fail if db does not support sub queries
 void testSubQuery2()
          test Subquery get all product groups without articles test may fail if db does not support sub queries
 void testSubQuery3()
          test Subquery get all product groups with more than 10 articles, uses attribute as value ! see testSubQuery4 for a better way test may fail if db does not support sub queries
 void testSubQuery4()
          test Subquery get all product groups with more than 10 articles test may fail if db does not support sub queries
 void tesXNestedJoins2()
          Test nested joins using pathExpressions *** Fails under hsqldb because of join using multiple keys ***
 void tesXReportPathExpressionAbstractExtent()
          test PathExpression pointing to abstract class (InterfaceArticle)
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

broker

PersistenceBroker broker
Constructor Detail

QueryTest

public QueryTest(java.lang.String name)
BrokerTests constructor comment.

Parameters:
name - java.lang.String
Method Detail

main

public static void main(java.lang.String[] args)
Insert the method's description here. Creation date: (23.12.2000 18:30:38)

Parameters:
args - java.lang.String[]

setUp

public void setUp()
Insert the method's description here. Creation date: (06.12.2000 21:58:53)


tearDown

public void tearDown()
Insert the method's description here. Creation date: (06.12.2000 21:59:14)


testCriteria

public void testCriteria()
Criteria containing other Criteria only


testEqualCriteria

public void testEqualCriteria()
test EqualTo Criteria


testSubQuery2

public void testSubQuery2()
test Subquery get all product groups without articles test may fail if db does not support sub queries


testSubQuery1

public void testSubQuery1()
test Subquery get all articles with price > avg(price) PROBLEM: avg(price) is NOT extent aware !! test may fail if db does not support sub queries


testSubQuery3

public void testSubQuery3()
test Subquery get all product groups with more than 10 articles, uses attribute as value ! see testSubQuery4 for a better way test may fail if db does not support sub queries


testSubQuery4

public void testSubQuery4()
test Subquery get all product groups with more than 10 articles test may fail if db does not support sub queries


testLikeCriteria

public void testLikeCriteria()
test Like Criteria


testLikeEscapedCriteria1

public void testLikeEscapedCriteria1()
test escaped Like Criteria


testLikeEscapedCriteria2

public void testLikeEscapedCriteria2()
test escaped Like Criteria with escape character


testNullCriteria

public void testNullCriteria()
test Null Criteria


testBetweenCriteria

public void testBetweenCriteria()
test Between Criteria


testInCriteria

public void testInCriteria()
test In Criteria


testPathExpressions

public void testPathExpressions()
Single Path Expression


testPathExpressionsMtoNDecomposed

public void testPathExpressionsMtoNDecomposed()
Multi Path Expression over decomposed m:n


testPathExpressionsMtoN

public void testPathExpressionsMtoN()
Multi Path Expression over nondecomposed m:n


testPathExpressionsMtoN2

public void testPathExpressionsMtoN2()
Multi Path Expression over nondecomposed m:n new test case for the 'not unique alias' problem with m:n relationship


testDistinct

public void testDistinct()
Distinct Query


testDistinctMultiPk

public void testDistinctMultiPk()
Distinct Query


testReportQuery

public void testReportQuery()
Simple ReportQuery returning rows with 3 columns of Person


testReportQueryWithJdbcTypes

public void testReportQueryWithJdbcTypes()
Simple ReportQuery returning rows with 3 columns of Person Type of column data defined by sqltypes

See Also:
Types

_testReportQueryWithStartAndEnd

public void _testReportQueryWithStartAndEnd()
Simple ReportQuery returning rows with 2 columns of Person needs SQL paging


testReportQueryExtent

public void testReportQueryExtent()
Simple ReportQuery returning rows with 2 columns of Person


testReportQueryPathExpression

public void testReportQueryPathExpression()
ReportQuery with pathExpression in columns


testReportQueryOrderBy

public void testReportQueryOrderBy()
ReportQuery returning rows with some "Liquor" data ordered by price


testReportQueryOrderByNonSelectColumn

public void testReportQueryOrderByNonSelectColumn()
ReportQuery returning rows with some "Liquor" data ordered by productGroup.groupId


testReportQueryGroupBy

public void testReportQueryGroupBy()
ReportQuery returning rows with summed stock and price per article group


testInversePathExpression

public void testInversePathExpression()
Read a CD and then read the ProductGroup for the CD


testPrefetchedArraySingleKey

public void testPrefetchedArraySingleKey()
prefetch Articles for ProductGroupsWithArray, Does not yet work with Arrays


testPrefetchedCollectionSingleKey

public void testPrefetchedCollectionSingleKey()
prefetch Articles for ProductGroups


testNestedJoins

public void testNestedJoins()
Test nested joins using pathExpressions


testMultipleJoins

public void testMultipleJoins()
Test multiple non nested joins using pathExpressions


tesXNestedJoins2

public void tesXNestedJoins2()
Test nested joins using pathExpressions *** Fails under hsqldb because of join using multiple keys ***


testPrefetchedReferencesSingleKey

public void testPrefetchedReferencesSingleKey()
prefetch ProductGroups for Articles


tesXReportPathExpressionAbstractExtent

public void tesXReportPathExpressionAbstractExtent()
test PathExpression pointing to abstract class (InterfaceArticle)


testQueryOrderByNonSelectColumn

public void testQueryOrderByNonSelectColumn()
ReportQuery returning rows with some "Liquor" data ordered by productGroup.groupId


testPathExpressionForAbstractExtent

public void testPathExpressionForAbstractExtent()
test PathExpression pointing to abstract class (InterfaceArticle)


testReportPathExpressionForExtents1

public void testReportPathExpressionForExtents1()
Test pathExpression and Extents


testReportPathExpressionForExtents2

public void testReportPathExpressionForExtents2()
Test pathExpression and Extents


testPathExpressionForExtents1

public void testPathExpressionForExtents1()
Test pathExpression and Extents


testPathExpressionForExtents2

public void testPathExpressionForExtents2()
Test pathExpression and Extents


testPathExpressionForExtents3

public void testPathExpressionForExtents3()
Test pathExpression and Extents musicians is only defined in CD


testPathExpressionForExtents4

public void testPathExpressionForExtents4()
Test pathExpression and Extents Abstract Base


testPathExpressionForExtentsAlias

public void testPathExpressionForExtentsAlias()
Test pathExpression and Extents using Alias


testQueryRangeOneLessThanTotal

public void testQueryRangeOneLessThanTotal()
Run a query range test that includes one record less than the total number of records that exist.


testQueryRangeAllRecords

public void testQueryRangeAllRecords()
Run a query range test that includes all of the records that exist.


testQueryRangeOneMoreThanTotal

public void testQueryRangeOneMoreThanTotal()
Run a query range test that includes one record more than the total number of records that exist.


testQueryMN_Alias1

public void testQueryMN_Alias1()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testQueryMN_Alias2

public void testQueryMN_Alias2()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testQueryMN

public void testQueryMN()
                 throws java.lang.Exception
Throws:
java.lang.Exception


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14