From d5bd90b96b512886fa9c1ef2f2e2782657bd97f0 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 10 May 2006 21:53:36 +0000 Subject: [PATCH] Added test to check that restore status was picking up missing destination node git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2831 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../node/archive/ArchiveAndRestoreTest.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/source/java/org/alfresco/repo/node/archive/ArchiveAndRestoreTest.java b/source/java/org/alfresco/repo/node/archive/ArchiveAndRestoreTest.java index 9ba9c0640d..f74b8bfabe 100644 --- a/source/java/org/alfresco/repo/node/archive/ArchiveAndRestoreTest.java +++ b/source/java/org/alfresco/repo/node/archive/ArchiveAndRestoreTest.java @@ -165,11 +165,11 @@ public class ArchiveAndRestoreTest extends TestCase * Create the following: *
      *        root
-     *       /  |  \
-     *      /   |   \
-     *     /    |    \
-     *    /     |     \
-     *   A  <-> B      X
+     *       /  |
+     *      /   |
+     *     /    |
+     *    /     |
+     *   A  <-> B
      *   |\    /|
      *   | \  / |
      *   |  \/  |
@@ -500,6 +500,17 @@ public class ArchiveAndRestoreTest extends TestCase
         txn.begin();
     }
     
+    public void testRestoreToMissingParent() throws Exception
+    {
+        nodeService.deleteNode(a);
+        nodeService.deleteNode(b);
+        commitAndBeginNewTransaction();
+        
+        // attempt to restore b_ to a
+        RestoreNodeReport report = nodeArchiveService.restoreArchivedNode(b_, a, null, null);
+        assertEquals("Incorrect report status", RestoreStatus.FAILURE_INVALID_PARENT, report.getStatus());
+    }
+    
     public void testMassRestore() throws Exception
     {
         nodeService.deleteNode(a);