public class TransferServiceToBeRefactoredTest extends BaseAlfrescoSpringTest
actionService, authenticationComponent, authenticationService, nodeService, rootNodeRef, storeRefsessionFactoryjdbcTemplatetransactionDefinition, transactionManager, transactionStatusAUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO| Constructor and Description |
|---|
TransferServiceToBeRefactoredTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onSetUp()
Called during the transaction setup
|
void |
runBare() |
void |
testCopyAlien()
Test the behaviour with respect to copy of alien nodes.
|
void |
testCopyTransferredNode()
Test the behaviour with regard to copying transferred nodes.
|
void |
testLocalAlienRestore()
Test restore of a local node.
|
void |
testMultiRepoTransfer()
Transfer sync from multiple repos.
|
void |
testMultiRepoTransferMove()
Test the transfer method behaviour with respect to move and alien nodes.
|
void |
testReadOnlyFlag()
Transfer with read only flag
Node tree for this test
|
void |
testTransferInvadedByLocalAlienNodes()
Test the transfer method behaviour with respect to sync with (local) alien nodes.
|
void |
testTransferReport()
Test the transfer report.
|
void |
testTransferSyncNodes()
Test the transfer method behaviour with respect to sync folders - sending a complete set
of nodes and implying delete from the absence of an association.
|
void |
testTransferWithPermissions()
Test the transfer method with regard to permissions on a node.
|
void |
testTwoRepoSync()
Transfer sync from multiple repos.
|
createNode, onSetUpInTransaction, onTearDownInTransactionflushAndClear, getConfigLocations, getSession, loadContext, setSessionFactorycountRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setDataSource, setSqlScriptEncodingendTransaction, isDefaultRollback, isRollback, onSetUpBeforeTransaction, onTearDown, onTearDownAfterTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransactiongetAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariablescontextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDownaddContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirtygetDisabledTestCount, isDisabledInThisEnvironment, recordDisabledcountTestCases, createResult, getName, run, run, runTest, setName, toStringassertEquals, 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, formatpublic void runBare()
throws java.lang.Throwable
runBare in class org.springframework.test.ConditionalTestCasejava.lang.Throwableprotected void onSetUp()
throws java.lang.Exception
onSetUp in class org.springframework.test.AbstractTransactionalSpringContextTestsjava.lang.Exceptionpublic void testTransferReport()
throws java.lang.Exception
java.lang.Exceptionpublic void testTransferSyncNodes()
throws java.lang.Exception
java.lang.Exceptionpublic void testTransferInvadedByLocalAlienNodes()
throws java.lang.Exception
Tree of nodes
A1
| | |
A2 A3 (Content Node) B9 (Alien Content Node)
|
A4 A5 B10 (Alien Content Node) A6
| |
A7 B11 (Alien Content Node) A8 B12 B13 (Alien Content Node)
|
B14
Test steps -
java.lang.Exceptionpublic void testLocalAlienRestore()
throws java.lang.Exception
Tree of nodes
A1 B1
|
B2
|
B3
- Add B2. A1 is alien.
- Delete B2. A1 not alien
- Restore B2. A1 is alien
- Add B3. A1 is alien
- Delete B2. A1 not alien
- Restore to B1. B2 and B3 not alien.
java.lang.Exceptionpublic void testTransferWithPermissions()
throws java.lang.Exception
Step 1: Create a node with a single permission Inherit:false Read, Admin, Allow Transfer
Step 2: Update it to have several permissions Inherit:false Read, Everyone, DENY Read, Admin, Allow
Step 3: Remove a permission Inherit:false Read, Admin, Allow
Step 4: Revert to inherit all permissions Inherit:true
This is a unit test so it does some shenanigans to send to the same instance of alfresco.
java.lang.Exceptionpublic void testReadOnlyFlag()
throws java.lang.Exception
A (Folder)
| |
B (Content) C (Folder)
|
D (Content)
Step 1
transfer Nodes ABCD with read only flag set - content should all be locked on destination
Step 2 lock B (Content node) as user fred transfer (read only) - destination lock should change to Admin
Step 3 lock C (Folder) as user fred transfer (read only) - destination lock should change to Admin
Step 4 transfer without read only flag - locks should revert from Admin to Fred.
Step 5 remove locks on A and B - transfer without read only flag - content should all be unlocked.
java.lang.Exceptionpublic void testTwoRepoSync()
throws java.lang.Exception
java.lang.Exceptionpublic void testMultiRepoTransfer()
throws java.lang.Exception
A1 B1 C1
| |
A2/images A2 Dummy/images
| |
A3 C3
Destination
B1
|
A2/images
| |
C3 A3
|
C4
Step 1. Transfer from A to B.
Step 2. Transfer from C to B (crossing over on A2Dest)
Step 3. Invade A3Dest via C4
Step 4. Delete C4. Sync from C
Step 5. Delete C3 - A2 dest images folder uninvaded.java.lang.Exceptionpublic void testMultiRepoTransferMove()
throws java.lang.Exception
B1
| | |
C2(p1) C3(p2) A4
|
A5
|
B6
Step 1: Tansfer in C's nodes to Repo B
Step 2. Transfer in A's nodes to Repo B
Setup tree above. Validat that A2 is child of C2 dest.
A4 is a child of B1
Step 3. Move A5 from C2 to C3 via transfer.
C2Dest should stop being invaded by A5, C3Dest should be invaded by A5.
Step 4. Invade A5 by B6. Move from C3 to C2 via transfer.
C2Dest should be invaded by A and B.
C3Dest should not be invaded.
Step 5. Move A5 to A4.
A4 should be invaded by B due to B6 but not by A.
C2Dest should not be invaded.java.lang.Exceptionpublic void testCopyTransferredNode()
throws java.lang.Exception
Transfer node read only
Copy transferred node.
New node should not be locked and should not be transferred.
This is a unit test so it does some shenanigans to send to the same instance of alfresco.
java.lang.Exceptionpublic void testCopyAlien()
throws java.lang.Exception
B1
| | |
C2(p1) C3(p2) A4
|
A5
|
B6
Step 1: Tansfer in C's nodes to Repo B
Step 2. Transfer in A's nodes to Repo B
Setup tree above. Validat that A2 is child of C2 dest.
A4 is a child of B1
Step 3. Copy A5 from C2 to C3.
C2Dest should still be invaded by A5
C3Dest should be invaded by A5(copy 1) which is now a "B" invader.
Step 4. Copy A5 from C2 to A4.
C2Dest should still be invaded by A5
A4Dest should be invaded by A5(copy 2) which is now a "B" invader.
Step 5. Invade A5 dest with B6.
Copy A5(Dest) to B1 (A5 Copy 3)
B1 should not be invaded.
A5 Copy 3 not invaded.
B6 Copy not invaded.
Step 6. Invade A5 dest with B6.
Copy A5(Dest) to B1 (A5 Copy 3) with children
B1 should not be invaded.
A5 Copy 4 not invaded.
B6 Copy not invaded.java.lang.ExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.