fri.util.database.jpa.tree.nestedsets
Class TemporalNestedSetsTreeTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by fri.util.database.jpa.commons.AbstractJpaTest
              extended by fri.util.database.jpa.tree.AbstractTreeTest<D,N>
                  extended by fri.util.database.jpa.tree.AbstractTemporalTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>
                      extended by fri.util.database.jpa.tree.nestedsets.TemporalNestedSetsTreeTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TemporalNestedSetsTreeEclipselinkTest, TemporalNestedSetsTreeHibernateSessionTest, TemporalNestedSetsTreeHibernateTest

public class TemporalNestedSetsTreeTest
extends AbstractTemporalTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

Author:
Fritz Ritzberger, 12.10.2011

Field Summary
 
Fields inherited from class fri.util.database.jpa.tree.AbstractTreeTest
COPIED_NAME_PREFIX, UNIQUE_PROPERTY_NAMES
 
Fields inherited from class fri.util.database.jpa.commons.AbstractJpaTest
ECLIPSELINK_PERSISTENCE_UNIT_NAME, HIBERNATE_PERSISTENCE_UNIT_NAME
 
Constructor Summary
TemporalNestedSetsTreeTest()
           
 
Method Summary
protected  void checkTreeIntegrity(DbSession session, NestedSetsTreeNode root)
           
protected  java.util.List<NestedSetsTreeNode> getFullTreeForIntegrityCheck(NestedSetsTreeNode root)
           
protected  java.lang.String getName(NestedSetsTreeNode node)
          For a concrete POJO we must return properties from it.
protected  TemporalNestedSetsTreeDao newDao(DbSession session)
          Overridden to allocate a new TemporalNestedSetsTreeDao for this test case.
protected  NestedSetsTreeNode newTreePojo(java.lang.String name)
          Factory method for new NestedSetsTreePojos.
protected  UniqueTreeConstraint<NestedSetsTreeNode> newUniqueChildrenTreeConstraintImpl()
           
protected  UniqueTreeConstraint<NestedSetsTreeNode> newUniqueChildrenTreeConstraintImplWithoutRoots()
           
protected  UniqueTreeConstraint<NestedSetsTreeNode> newUniqueWholeTreeConstraintImpl()
           
protected  UniqueTreeConstraint<NestedSetsTreeNode> newUniqueWholeTreeConstraintImplWithoutRoots()
           
protected  void renameBeforeCopy(NestedSetsTreeNode node)
           
protected  void setNameNotConstraintChecking(NestedSetsTreeNode entity, java.lang.String name)
           
protected  void setValid(NestedSetsTreeNode entity)
          To be overridden by temporal test.
 
Methods inherited from class fri.util.database.jpa.tree.AbstractTemporalTreeTest
getTemporalDao, tearDown, testDatabaseToBeCaseSensitive, testFindChildrenInFullTree, testFindRemoved, testRemoveHistoricizedTreesPhysically, testRemoveRootPhysically, testRemoveSubTreePhysically, testUniquenessWithNullValidFrom, testUnremove, testUnremoveAllRoots, testValidFromIsNull
 
Methods inherited from class fri.util.database.jpa.tree.AbstractTreeTest
assertTreeCacheable, beginDbTransaction, commitDbTransaction, createTree, createTree, createTree, findByName, getDao, isTestCopy, newDbSession, outputTree, outputTree, rollbackDbTransaction, setName, testAddToTree, testBigTree, testCopiedNodeRenamer, testCopyRootToBeRoot, testCopyToOtherRoot, testCopyToSelf, testCopyTree, testCopyTreeBelowItselfFails, testCopyTreeFailsWithUniqueConstraint, testCopyTreeToAlteredName, testCopyTreeToAlteredNameWithUniqueConstraint, testCopyTreeToBeRoot, testCopyTreeWithPrecedingDelete, testCreateAndRemoveRoot, testCreateTree, testFindChildrenInCachedTree, testGetRoots, testIsBelow, testIsRoot, testLevel, testMoveRootToOtherTree, testMoveToOtherTree, testMoveTree, testMoveTreeBelowItselfFails, testMoveTreeToBeRoot, testNonUniqueRootsButUniqueChildren, testNonUniqueRootsButWholeTreeUniqueNodes, testParent, testPath, testRemoveAllTrees, testRemoveFromTree, testRemoveTree, testUniqueChildrenConstraint, testUniqueness, testUniquenessWithDeletion, testUniqueWholeTreeConstraintOnMove, testUpdateNode, testUpdateRootWithWholeTreeUniqueConstraint, testUpdateToSameNameWithUniqueConstraint
 
Methods inherited from class fri.util.database.jpa.commons.AbstractJpaTest
beginTransaction, commitTransaction, getPersistenceUnitName, log, logAfterEnd, logBeforeEnd, logStart, rollbackTransaction, setUp
 
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

TemporalNestedSetsTreeTest

public TemporalNestedSetsTreeTest()
Method Detail

newDao

protected TemporalNestedSetsTreeDao newDao(DbSession session)
Overridden to allocate a new TemporalNestedSetsTreeDao for this test case.

Specified by:
newDao in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>
Returns:
a new DAO for passed session. To be overridden by subclasses.

newTreePojo

protected NestedSetsTreeNode newTreePojo(java.lang.String name)
Description copied from class: AbstractTreeTest
Factory method for new NestedSetsTreePojos. To be overridden by subclasses.

Specified by:
newTreePojo in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

getName

protected java.lang.String getName(NestedSetsTreeNode node)
Description copied from class: AbstractTreeTest
For a concrete POJO we must return properties from it. Here the cast to NestedSetsTreePojo is done.

Specified by:
getName in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

setNameNotConstraintChecking

protected void setNameNotConstraintChecking(NestedSetsTreeNode entity,
                                            java.lang.String name)
Specified by:
setNameNotConstraintChecking in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

renameBeforeCopy

protected void renameBeforeCopy(NestedSetsTreeNode node)
Specified by:
renameBeforeCopy in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

setValid

protected void setValid(NestedSetsTreeNode entity)
Description copied from class: AbstractTreeTest
To be overridden by temporal test.

Overrides:
setValid in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

newUniqueWholeTreeConstraintImpl

protected UniqueTreeConstraint<NestedSetsTreeNode> newUniqueWholeTreeConstraintImpl()
Specified by:
newUniqueWholeTreeConstraintImpl in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>
Returns:
an UniqueTreeConstraint implementation that checks for uniqueness per tree.

newUniqueWholeTreeConstraintImplWithoutRoots

protected UniqueTreeConstraint<NestedSetsTreeNode> newUniqueWholeTreeConstraintImplWithoutRoots()
Specified by:
newUniqueWholeTreeConstraintImplWithoutRoots in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>
Returns:
an UniqueTreeConstraint implementation that checks for uniqueness per tree.

newUniqueChildrenTreeConstraintImpl

protected UniqueTreeConstraint<NestedSetsTreeNode> newUniqueChildrenTreeConstraintImpl()
Specified by:
newUniqueChildrenTreeConstraintImpl in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>
Returns:
an UniqueTreeConstraint implementation that checks for uniqueness on child level only.

newUniqueChildrenTreeConstraintImplWithoutRoots

protected UniqueTreeConstraint<NestedSetsTreeNode> newUniqueChildrenTreeConstraintImplWithoutRoots()
Specified by:
newUniqueChildrenTreeConstraintImplWithoutRoots in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>
Returns:
an UniqueTreeConstraint implementation that checks for uniqueness on child level only, ignoring uniqueness among roots.

getFullTreeForIntegrityCheck

protected java.util.List<NestedSetsTreeNode> getFullTreeForIntegrityCheck(NestedSetsTreeNode root)
Overrides:
getFullTreeForIntegrityCheck in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>

checkTreeIntegrity

protected void checkTreeIntegrity(DbSession session,
                                  NestedSetsTreeNode root)
Specified by:
checkTreeIntegrity in class AbstractTreeTest<TemporalNestedSetsTreeDao,NestedSetsTreeNode>