org.apache.jackrabbit.test.api.query
Class OrderByDateTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jackrabbit.test.JUnitTest
              extended by org.apache.jackrabbit.test.AbstractJCRTest
                  extended by org.apache.jackrabbit.test.api.query.AbstractQueryTest
                      extended by org.apache.jackrabbit.test.api.query.OrderByDateTest
All Implemented Interfaces:
junit.framework.Test

public class OrderByDateTest
extends AbstractQueryTest

Test cases for order by queries on date properties.


Field Summary
protected  boolean checkSQL
          If true this repository supports sql queries
 
Fields inherited from class org.apache.jackrabbit.test.api.query.AbstractQueryTest
jcrContains, jcrDeref, jcrPath, jcrRoot, jcrScore
 
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, jcrFrozenUuid, jcrIsCheckedOut, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixShareable, mixSimpleVersionable, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
OrderByDateTest()
           
 
Method Summary
protected  void checkOrder(String[] nodeNames)
          Runs queries on the workspace and checks if the ordering is according to the nodeNames.
protected  void checkResultOrder(QueryResult result, String[] nodeNames)
          Checks if the node ordering in result is according to nodeNames.
protected  void populate(Calendar[] values)
          Populates the workspace with child nodes under testroot with each node has a calendar value set in property with name propertyname1.
protected  void populate(double[] values)
          Populates the workspace with child nodes under testroot with each node has a double value set in property with name propertyname1.
protected  void populate(long[] values)
          Populates the workspace with child nodes under testroot with each node has a long value set in property with name propertyname1.
protected  void populate(String[] values)
          Populates the workspace with child nodes under testroot with each node has a String value set in property with name propertyname1.
protected  void setUp()
          Set-up the configuration values used for the test.
 void testDateOrder()
          Tests order by queries with calendar properties.
 void testDateOrderMillis()
          Tests order by queries with calendar properties where the calendar values only have a millisecond difference.
 void testDateOrderNegativeTimeZone()
          Tests order by queries with calendar properties where the calendar values have different time zones.
 void testDateOrderPositiveTimeZone()
          Tests order by queries with calendar properties where the calendar values have different time zones.
 
Methods inherited from class org.apache.jackrabbit.test.api.query.AbstractQueryTest
checkResult, checkResult, checkResult, createQuery, createQuery, escapeIdentifierForSQL, evaluateResultOrder, execute, execute, executeSqlQuery, executeXPathQuery, toArray
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureMultipleWorkspacesSupported, getJcrValue, getNonExistingWorkspaceName, getProperty, getProperty, getSize, isSupported, needsMixin, run, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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

checkSQL

protected boolean checkSQL
If true this repository supports sql queries

Constructor Detail

OrderByDateTest

public OrderByDateTest()
Method Detail

testDateOrder

public void testDateOrder()
                   throws Exception
Tests order by queries with calendar properties.

Throws:
Exception

testDateOrderMillis

public void testDateOrderMillis()
                         throws Exception
Tests order by queries with calendar properties where the calendar values only have a millisecond difference.

Throws:
Exception

testDateOrderPositiveTimeZone

public void testDateOrderPositiveTimeZone()
                                   throws Exception
Tests order by queries with calendar properties where the calendar values have different time zones.

Throws:
Exception

testDateOrderNegativeTimeZone

public void testDateOrderNegativeTimeZone()
                                   throws Exception
Tests order by queries with calendar properties where the calendar values have different time zones.

Throws:
Exception

setUp

protected void setUp()
              throws Exception
Description copied from class: AbstractQueryTest
Set-up the configuration values used for the test. Per default retrieves a session, configures testRoot, and nodetype and checks if the query language for the current language is available.

Overrides:
setUp in class AbstractQueryTest
Throws:
Exception

populate

protected void populate(String[] values)
                 throws RepositoryException
Populates the workspace with child nodes under testroot with each node has a String value set in property with name propertyname1.

Parameters:
values - the String values.
Throws:
RepositoryException

populate

protected void populate(Calendar[] values)
                 throws RepositoryException
Populates the workspace with child nodes under testroot with each node has a calendar value set in property with name propertyname1.

Parameters:
values - the calendar values.
Throws:
RepositoryException

populate

protected void populate(long[] values)
                 throws RepositoryException
Populates the workspace with child nodes under testroot with each node has a long value set in property with name propertyname1.

Parameters:
values - the long values.
Throws:
RepositoryException

populate

protected void populate(double[] values)
                 throws RepositoryException
Populates the workspace with child nodes under testroot with each node has a double value set in property with name propertyname1.

Parameters:
values - the double values.
Throws:
RepositoryException

checkOrder

protected void checkOrder(String[] nodeNames)
                   throws RepositoryException
Runs queries on the workspace and checks if the ordering is according to the nodeNames.

Parameters:
nodeNames - the sequence of node names required in the result set.
Throws:
RepositoryException

checkResultOrder

protected void checkResultOrder(QueryResult result,
                                String[] nodeNames)
                         throws RepositoryException
Checks if the node ordering in result is according to nodeNames.

Parameters:
result - the query result.
nodeNames - the node names.
Throws:
RepositoryException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.