fri.util.database.jpa.tree.closuretable
Class TemporalClosureTableTreeTest

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<TemporalClosureTableTreeDao,ClosureTableTreeNode>
                      extended by fri.util.database.jpa.tree.closuretable.TemporalClosureTableTreeTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TemporalClosureTableTreeEclipselinkTest, TemporalClosureTableTreeHibernateSessionTest, TemporalClosureTableTreeHibernateTest

public class TemporalClosureTableTreeTest
extends AbstractTemporalTreeTest<TemporalClosureTableTreeDao,ClosureTableTreeNode>

Author:
Fritz Ritzberger, 03.11.2012

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
TemporalClosureTableTreeTest()
           
 
Method Summary
protected  void checkTreeIntegrity(DbSession session, ClosureTableTreeNode root)
           
protected  java.lang.String getName(ClosureTableTreeNode node)
          For a concrete POJO we must return properties from it.
protected  TemporalClosureTableTreeDao newDao(DbSession session)
          Overridden to allocate a new TemporalClosureTableTreeDao for this test case.
protected  ClosureTableTreeNode newTreePojo(java.lang.String name)
          Factory method for new NestedSetsTreePojos.
protected  UniqueTreeConstraint<ClosureTableTreeNode> newUniqueChildrenTreeConstraintImpl()
           
protected  UniqueTreeConstraint<ClosureTableTreeNode> newUniqueChildrenTreeConstraintImplWithoutRoots()
           
protected  UniqueTreeConstraint<ClosureTableTreeNode> newUniqueWholeTreeConstraintImpl()
           
protected  UniqueTreeConstraint<ClosureTableTreeNode> newUniqueWholeTreeConstraintImplWithoutRoots()
           
protected  void renameBeforeCopy(ClosureTableTreeNode node)
           
protected  void setNameNotConstraintChecking(ClosureTableTreeNode node, java.lang.String name)
           
 void testGetTreePathEntity()
           
 
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, getFullTreeForIntegrityCheck, isTestCopy, newDbSession, outputTree, outputTree, rollbackDbTransaction, setName, setValid, 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

TemporalClosureTableTreeTest

public TemporalClosureTableTreeTest()
Method Detail

testGetTreePathEntity

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

newDao

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

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

newUniqueWholeTreeConstraintImpl

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

newUniqueWholeTreeConstraintImplWithoutRoots

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

newUniqueChildrenTreeConstraintImpl

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

newUniqueChildrenTreeConstraintImplWithoutRoots

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

newTreePojo

protected ClosureTableTreeNode 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<TemporalClosureTableTreeDao,ClosureTableTreeNode>

getName

protected java.lang.String getName(ClosureTableTreeNode 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<TemporalClosureTableTreeDao,ClosureTableTreeNode>

setNameNotConstraintChecking

protected void setNameNotConstraintChecking(ClosureTableTreeNode node,
                                            java.lang.String name)
Specified by:
setNameNotConstraintChecking in class AbstractTreeTest<TemporalClosureTableTreeDao,ClosureTableTreeNode>

renameBeforeCopy

protected void renameBeforeCopy(ClosureTableTreeNode node)
Specified by:
renameBeforeCopy in class AbstractTreeTest<TemporalClosureTableTreeDao,ClosureTableTreeNode>

checkTreeIntegrity

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