org.alfresco.repo.version
Class BaseVersionStoreTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.test.ConditionalTestCase
              extended by org.springframework.test.AbstractSpringContextTests
                  extended by org.springframework.test.AbstractSingleSpringContextTests
                      extended by org.springframework.test.AbstractDependencyInjectionSpringContextTests
                          extended by org.springframework.test.AbstractTransactionalSpringContextTests
                              extended by org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                  extended by org.alfresco.util.BaseSpringTest
                                      extended by org.alfresco.repo.version.BaseVersionStoreTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ContentServiceImplTest, NodeServiceImplTest, VersionMigratorTest, VersionServiceImplTest

public abstract class BaseVersionStoreTest
extends BaseSpringTest


Field Summary
protected  MutableAuthenticationDao authenticationDAO
           
protected  MutableAuthenticationService authenticationService
           
protected  ContentService contentService
           
protected  org.alfresco.service.cmr.repository.NodeService dbNodeService
           
protected  org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO
           
protected  org.alfresco.service.cmr.repository.MLText mlText
           
protected static org.alfresco.service.namespace.QName MLTEXT_PROP
           
protected static org.alfresco.service.namespace.QName MULTI_PROP
           
protected static java.lang.String MULTI_VALUE_1
           
protected static java.lang.String MULTI_VALUE_2
           
protected  java.util.Collection multiValue
           
protected  NodeArchiveService nodeArchiveService
           
protected  java.util.HashMap nodeProperties
           
protected  org.alfresco.service.cmr.repository.NodeService nodeService
           
protected  org.alfresco.service.cmr.security.PermissionService permissionService
           
protected static org.alfresco.service.namespace.QName PROP_1
           
protected static org.alfresco.service.namespace.QName PROP_2
           
protected static org.alfresco.service.namespace.QName PROP_3
           
protected  org.alfresco.service.cmr.repository.NodeRef rootNodeRef
           
protected static org.alfresco.service.namespace.QName TEST_ASPECT_QNAME
           
protected static org.alfresco.service.namespace.QName TEST_ASSOC
           
protected static org.alfresco.service.namespace.QName TEST_CHILD_ASSOC_1
           
protected static org.alfresco.service.namespace.QName TEST_CHILD_ASSOC_2
           
protected static java.lang.String TEST_CONTENT
          Test content
protected static java.lang.String TEST_NAMESPACE
           
protected static org.alfresco.service.namespace.QName TEST_TYPE_QNAME
           
protected  org.alfresco.service.cmr.repository.StoreRef testStoreRef
           
protected  TransactionService transactionService
           
protected  RetryingTransactionHelper txnHelper
           
protected static java.lang.String VALUE_1
           
protected static java.lang.String VALUE_2
           
protected static java.lang.String VALUE_3
           
protected static java.lang.String VERSION_PROP_1
           
protected static java.lang.String VERSION_PROP_2
           
protected static java.lang.String VERSION_PROP_3
           
protected  java.util.HashMap versionableNodes
          The most recent set of versionable nodes created by createVersionableNode
protected  java.util.Map versionProperties
           
protected  VersionService versionService
           
 
Fields inherited from class org.alfresco.util.BaseSpringTest
sessionFactory
 
Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
jdbcTemplate
 
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
 
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
 
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
 
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
 
Constructor Summary
BaseVersionStoreTest()
           
 
Method Summary
protected  void checkNewVersion(long beforeVersionTime, java.lang.String expectedVersionLabel, Version newVersion, org.alfresco.service.cmr.repository.NodeRef versionableNode)
           
protected  void checkVersion(long beforeVersionTime, java.lang.String expectedVersionLabel, Version newVersion, org.alfresco.service.cmr.repository.NodeRef versionableNode)
          Checkd the validity of a new version
protected  org.alfresco.service.cmr.repository.NodeRef createNewNode()
           
protected  org.alfresco.service.cmr.repository.NodeRef createNewVersionableNode()
          Creates a new versionable node
protected  org.alfresco.service.cmr.repository.NodeRef createNode(boolean versionable, org.alfresco.service.namespace.QName nodeType)
           
protected  Version createVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode)
          Creates a new version, checking the properties of the version.
protected  Version createVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode, java.util.Map versionProperties)
          Creates a new version, checking the properties of the version.
protected  java.util.Collection createVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode, java.util.Map versionProperties, boolean versionChildren)
           
protected  void onSetUpInTransaction()
          Called during the transaction setup
protected  java.lang.String peekNextVersionLabel(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map versionProperties)
          Gets the next version label
 void setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)
          Sets the meta model dao
 void setVersionService(VersionService versionService)
           
 
Methods inherited from class org.alfresco.util.BaseSpringTest
flushAndClear, getConfigLocations, getSession, loadContext, setSessionFactory
 
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setDataSource, setSqlScriptEncoding
 
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, isRollback, onSetUp, onSetUpBeforeTransaction, onTearDown, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
 
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
 
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDown
 
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
 
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, 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
 

Field Detail

dbNodeService

protected org.alfresco.service.cmr.repository.NodeService dbNodeService

versionService

protected VersionService versionService

contentService

protected ContentService contentService

dictionaryDAO

protected org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO

authenticationService

protected MutableAuthenticationService authenticationService

transactionService

protected TransactionService transactionService

txnHelper

protected RetryingTransactionHelper txnHelper

authenticationDAO

protected MutableAuthenticationDao authenticationDAO

nodeArchiveService

protected NodeArchiveService nodeArchiveService

nodeService

protected org.alfresco.service.cmr.repository.NodeService nodeService

permissionService

protected org.alfresco.service.cmr.security.PermissionService permissionService

testStoreRef

protected org.alfresco.service.cmr.repository.StoreRef testStoreRef

rootNodeRef

protected org.alfresco.service.cmr.repository.NodeRef rootNodeRef

versionProperties

protected java.util.Map versionProperties

nodeProperties

protected java.util.HashMap nodeProperties

versionableNodes

protected java.util.HashMap versionableNodes
The most recent set of versionable nodes created by createVersionableNode


TEST_NAMESPACE

protected static final java.lang.String TEST_NAMESPACE
See Also:
Constant Field Values

TEST_TYPE_QNAME

protected static final org.alfresco.service.namespace.QName TEST_TYPE_QNAME

TEST_ASPECT_QNAME

protected static final org.alfresco.service.namespace.QName TEST_ASPECT_QNAME

PROP_1

protected static final org.alfresco.service.namespace.QName PROP_1

PROP_2

protected static final org.alfresco.service.namespace.QName PROP_2

PROP_3

protected static final org.alfresco.service.namespace.QName PROP_3

MULTI_PROP

protected static final org.alfresco.service.namespace.QName MULTI_PROP

VERSION_PROP_1

protected static final java.lang.String VERSION_PROP_1
See Also:
Constant Field Values

VERSION_PROP_2

protected static final java.lang.String VERSION_PROP_2
See Also:
Constant Field Values

VERSION_PROP_3

protected static final java.lang.String VERSION_PROP_3
See Also:
Constant Field Values

VALUE_1

protected static final java.lang.String VALUE_1
See Also:
Constant Field Values

VALUE_2

protected static final java.lang.String VALUE_2
See Also:
Constant Field Values

VALUE_3

protected static final java.lang.String VALUE_3
See Also:
Constant Field Values

TEST_CHILD_ASSOC_1

protected static final org.alfresco.service.namespace.QName TEST_CHILD_ASSOC_1

TEST_CHILD_ASSOC_2

protected static final org.alfresco.service.namespace.QName TEST_CHILD_ASSOC_2

TEST_ASSOC

protected static final org.alfresco.service.namespace.QName TEST_ASSOC

multiValue

protected java.util.Collection multiValue

MULTI_VALUE_1

protected static final java.lang.String MULTI_VALUE_1
See Also:
Constant Field Values

MULTI_VALUE_2

protected static final java.lang.String MULTI_VALUE_2
See Also:
Constant Field Values

mlText

protected org.alfresco.service.cmr.repository.MLText mlText

MLTEXT_PROP

protected static final org.alfresco.service.namespace.QName MLTEXT_PROP

TEST_CONTENT

protected static final java.lang.String TEST_CONTENT
Test content

See Also:
Constant Field Values
Constructor Detail

BaseVersionStoreTest

public BaseVersionStoreTest()
Method Detail

setDictionaryDAO

public void setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO)
Sets the meta model dao

Parameters:
dictionaryDAO - the meta model dao

setVersionService

public void setVersionService(VersionService versionService)

onSetUpInTransaction

protected void onSetUpInTransaction()
                             throws java.lang.Exception
Called during the transaction setup

Overrides:
onSetUpInTransaction in class org.springframework.test.AbstractTransactionalSpringContextTests
Throws:
java.lang.Exception

createNewVersionableNode

protected org.alfresco.service.cmr.repository.NodeRef createNewVersionableNode()
Creates a new versionable node

Returns:
the node reference

createNewNode

protected org.alfresco.service.cmr.repository.NodeRef createNewNode()

createNode

protected org.alfresco.service.cmr.repository.NodeRef createNode(boolean versionable,
                                                                 org.alfresco.service.namespace.QName nodeType)

createVersion

protected Version createVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode)
Creates a new version, checking the properties of the version.

The default test propreties are assigned to the version.

Parameters:
versionableNode - the versionable node
Returns:
the created (and checked) new version

createVersion

protected Version createVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode,
                                java.util.Map versionProperties)
Creates a new version, checking the properties of the version.

Parameters:
versionableNode - the versionable node
versionProperties - the version properties
Returns:
the created (and checked) new version

createVersion

protected java.util.Collection createVersion(org.alfresco.service.cmr.repository.NodeRef versionableNode,
                                             java.util.Map versionProperties,
                                             boolean versionChildren)

peekNextVersionLabel

protected java.lang.String peekNextVersionLabel(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                java.util.Map versionProperties)
Gets the next version label


checkVersion

protected void checkVersion(long beforeVersionTime,
                            java.lang.String expectedVersionLabel,
                            Version newVersion,
                            org.alfresco.service.cmr.repository.NodeRef versionableNode)
Checkd the validity of a new version

Parameters:
beforeVersionTime - the time snap shot before the version was created
newVersion - the new version
versionableNode - the versioned node

checkNewVersion

protected void checkNewVersion(long beforeVersionTime,
                               java.lang.String expectedVersionLabel,
                               Version newVersion,
                               org.alfresco.service.cmr.repository.NodeRef versionableNode)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.