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

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<ClosureTableTreeDao,ClosureTableTreeNode>
                  extended by fri.util.database.jpa.tree.closuretable.ClosureTableTreeTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ClosureTableTreeEclipselinkTest, ClosureTableTreeHibernateSessionTest, ClosureTableTreeHibernateTest

public class ClosureTableTreeTest
extends AbstractTreeTest<ClosureTableTreeDao,ClosureTableTreeNode>

Author:
Fritz Ritzberger, 19.10.2012

Field Summary
 
Fields inherited from class fri.util.database.jpa.tree.AbstractTreeTest
COPIED_NAME_PREFIX
 
Fields inherited from class fri.util.database.jpa.commons.AbstractJpaTest
ECLIPSELINK_PERSISTENCE_UNIT_NAME, HIBERNATE_PERSISTENCE_UNIT_NAME
 
Constructor Summary
ClosureTableTreeTest()
           
 
Method Summary
protected  void checkTreeIntegrity(DbSession session, ClosureTableTreeNode root)
          Checks that no ClosureTableTreeNode is not connected to TreePath.
protected  java.lang.String getName(ClosureTableTreeNode node)
          For a concrete POJO we must return properties from it.
protected  ClosureTableTreeDao newDao(DbSession session)
          Overridden to allocate a new ClosureTableTreeDao 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.AbstractTreeTest
assertTreeCacheable, beginDbTransaction, commitDbTransaction, createTree, createTree, createTree, findByName, getDao, getFullTreeForIntegrityCheck, isTestCopy, newDbSession, outputTree, outputTree, rollbackDbTransaction, setName, setValid, tearDown, testAddToTree, testBigTree, testCopiedNodeRenamer, testCopyRootToBeRoot, testCopyToOtherRoot, testCopyToSelf, testCopyTree, testCopyTreeBelowItselfFails, testCopyTreeFailsWithUniqueConstraint, testCopyTreeToAlteredName, testCopyTreeToAlteredNameWithUniqueConstraint, testCopyTreeToBeRoot, testCopyTreeWithPrecedingDelete, testCreateAndRemoveRoot, testCreateTree, testDatabaseToBeCaseSensitive, 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

ClosureTableTreeTest

public ClosureTableTreeTest()
Method Detail

testGetTreePathEntity

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

newDao

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

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

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<ClosureTableTreeDao,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<ClosureTableTreeDao,ClosureTableTreeNode>

setNameNotConstraintChecking

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

renameBeforeCopy

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

newUniqueWholeTreeConstraintImpl

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

newUniqueWholeTreeConstraintImplWithoutRoots

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

newUniqueChildrenTreeConstraintImpl

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

newUniqueChildrenTreeConstraintImplWithoutRoots

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

checkTreeIntegrity

protected void checkTreeIntegrity(DbSession session,
                                  ClosureTableTreeNode root)
Checks that no ClosureTableTreeNode is not connected to TreePath.

Specified by:
checkTreeIntegrity in class AbstractTreeTest<ClosureTableTreeDao,ClosureTableTreeNode>