You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by an...@apache.org on 2013/07/25 11:42:31 UTC
svn commit: r1506866 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml
src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java
Author: angela
Date: Thu Jul 25 09:42:31 2013
New Revision: 1506866
URL: http://svn.apache.org/r1506866
Log:
OAK-773 : Workspace Import
- fix issues with SerialiationTest#testOverwriteExisting* tests and remove them from the known issues.
Modified:
jackrabbit/oak/trunk/oak-jcr/pom.xml
jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java
Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1506866&r1=1506865&r2=1506866&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Thu Jul 25 09:42:31 2013
@@ -67,16 +67,10 @@
org.apache.jackrabbit.test.api.WorkspaceMoveTest#testMoveNodesAccessDenied <!-- OAK-118 -->
<!-- locking not implemented -->
- org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionWorkspaceWithHandler <!-- OAK-127: no session scoped locking -->
- org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionSessionWithHandler <!-- OAK-127: no session scoped locking -->
- org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionWorkspace <!-- OAK-127: no session scoped locking -->
- org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionSession <!-- OAK-127: no session scoped locking -->
-
- <!-- overwrite not detected during import -->
- org.apache.jackrabbit.test.api.SerializationTest#testOverwriteExceptionWorkspaceWithHandler <!-- OAK-127: overwrite -->
- org.apache.jackrabbit.test.api.SerializationTest#testOverwriteExceptionSessionWithHandler <!-- OAK-127: overwrite -->
- org.apache.jackrabbit.test.api.SerializationTest#testOverwriteExceptionWorkspace <!-- OAK-127: overwrite -->
- org.apache.jackrabbit.test.api.SerializationTest#testOverwriteExceptionSession <!-- OAK-127: overwrite -->
+ org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionWorkspaceWithHandler <!-- OAK-127: no session scoped locking -->
+ org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionSessionWithHandler <!-- OAK-127: no session scoped locking -->
+ org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionWorkspace <!-- OAK-127: no session scoped locking -->
+ org.apache.jackrabbit.test.api.SerializationTest#testLockExceptionSession <!-- OAK-127: no session scoped locking -->
org.apache.jackrabbit.test.api.lock.LockManagerTest#testAddInvalidLockToken <!-- OAK-150 ... -->
org.apache.jackrabbit.test.api.lock.LockManagerTest#testLockNonLockable
Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java?rev=1506866&r1=1506865&r2=1506866&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImporterImpl.java Thu Jul 25 09:42:31 2013
@@ -110,6 +110,7 @@ public class ImporterImpl implements Imp
throw new RepositoryException("Pending changes on session. Cannot run workspace import.");
}
+ this.uuidBehavior = uuidBehavior;
importTargetTree = root.getTree(absPath);
if (!importTargetTree.exists()) {
throw new PathNotFoundException(absPath);
@@ -124,9 +125,6 @@ public class ImporterImpl implements Imp
}
ntTypesRoot = root.getTree(NODE_TYPES_PATH);
-
- this.uuidBehavior = uuidBehavior;
-
userID = sessionContext.getSessionDelegate().getAuthInfo().getUserID();
accessManager = sessionContext.getAccessManager();
idManager = new IdentifierManager(root);
@@ -338,8 +336,8 @@ public class ImporterImpl implements Imp
} else {
// edge case: colliding node does have same uuid
// (see http://issues.apache.org/jira/browse/JCR-1128)
- String uuid = TreeUtil.getString(existing, JcrConstants.JCR_UUID);
- if (uuid != null && !(uuid.equals(id)
+ String existingIdentifier = IdentifierManager.getIdentifier(existing);
+ if (!(existingIdentifier.equals(id)
&& (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
|| uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING))) {
throw new ItemExistsException(